Merge pull request #6766 from penpot/elenatorro-fix-text-auto-height

🐛 Fix text auto height
This commit is contained in:
Elena Torró 2025-06-24 13:18:28 +02:00 committed by GitHub
commit 9f5cb61a19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 2008 additions and 4 deletions

View file

@ -49,10 +49,17 @@ pub extern "C" fn get_text_dimensions() -> *mut u8 {
if let Type::Text(content) = &shape.shape_type {
let paragraphs = content.get_skia_paragraphs(font_col);
height = auto_height(&paragraphs).ceil();
m_width = max_width(&paragraphs);
if content.grow_type() == GrowType::AutoWidth {
width = auto_width(&paragraphs).ceil();
match content.grow_type() {
GrowType::AutoHeight => {
height = auto_height(&paragraphs).ceil();
}
GrowType::AutoWidth => {
width = auto_width(&paragraphs).ceil();
height = auto_height(&paragraphs).ceil();
}
GrowType::Fixed => {}
}
}
});