Fix #1423: an Affinity text frame too short for its first line is made taller instead of showing nothing

This commit is contained in:
bflatastic
2026-10-12 23:42:56 +07:00
parent ffa948dcc3
commit 988f52ecc8
7 changed files with 58 additions and 26 deletions
+4
View File
@@ -488,6 +488,10 @@ impl Builder {
};
if let Some(f) = t.frame {
obj.kind = TextKind::Area { frame: shapes::rectangle(Rect::new(0.0, 0.0, (f.x1 - f.x0) * k, (f.y1 - f.y0) * k)) };
// Affinity shows a line in a frame shorter than it (#1423); here none of it would draw.
if vectorcraft_text::fit_first_line(vectorcraft_text::FontDb::global(), &mut obj) {
self.warn("text frames too short for their first line (made taller so the line shows)");
}
}
obj
}