Allow for undefined buffer width and/or height, fixes #70
This commit is contained in:
parent
cd1cd0a337
commit
93a7df859a
15 changed files with 99 additions and 72 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue