Fixes for resizing

This commit is contained in:
Jeremy Soller 2023-10-11 19:32:04 -06:00
parent 2425c7eb49
commit c393cca602
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
4 changed files with 348 additions and 706 deletions

View file

@ -177,7 +177,6 @@ where
let height = layout_lines as f32 * editor.buffer().metrics().line_height;
let size = Size::new(limits.max().width, height);
log::info!("size {:?}", size);
layout::Node::new(limits.resolve(size))
}
@ -244,6 +243,11 @@ where
let image_w = (view_w as f64 * scale_factor) as i32;
let image_h = (view_h as f64 * scale_factor) as i32;
if image_w <= 0 || image_h <= 0 {
// Zero sized image
return;
}
let mut font_system = FONT_SYSTEM.lock().unwrap();
let mut editor = editor.borrow_with(&mut font_system);