Allow for undefined buffer width and/or height, fixes #70

This commit is contained in:
Jeremy Soller 2024-06-12 09:04:04 -06:00
parent cd1cd0a337
commit 93a7df859a
15 changed files with 99 additions and 72 deletions

View file

@ -89,8 +89,8 @@ impl DrawTestCfg {
let mut buffer = buffer.borrow_with(&mut font_system);
let margins = 5;
buffer.set_size(
(self.canvas_width - margins * 2) as f32,
(self.canvas_height - margins * 2) as f32,
Some((self.canvas_width - margins * 2) as f32),
Some((self.canvas_height - margins * 2) as f32),
);
buffer.set_text(&self.text, self.font.as_attrs(), Shaping::Advanced);
buffer.shape_until_scroll(true);