Fix image support

This commit is contained in:
Isaac Mills 2024-04-19 11:18:49 -04:00
parent a0355d2c71
commit e555f2fa77
Signed by: fnmain
GPG key ID: B67D7410F33A0F61

View file

@ -262,8 +262,10 @@ pub fn resolve_paragraphs<'a>(
let new_size = scale_to_fit(image_size, max_size, true);
buffer.relative_bounds =
Rect::from_min_size(Pos2::new(buffer.indent.indent, size.y), new_size);
if last_image_size.is_none() {
size.y += new_size.y
if let Some(last_image_size) = &mut last_image_size {
last_image_size.y -= image_size.y - new_size.y;
} else {
size.y += new_size.y + margin
}
}