mirror of
https://github.com/penpot/penpot.git
synced 2025-07-12 16:57:17 +02:00
Merge pull request #6766 from penpot/elenatorro-fix-text-auto-height
🐛 Fix text auto height
This commit is contained in:
commit
9f5cb61a19
7 changed files with 2008 additions and 4 deletions
|
@ -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(¶graphs).ceil();
|
||||
m_width = max_width(¶graphs);
|
||||
if content.grow_type() == GrowType::AutoWidth {
|
||||
width = auto_width(¶graphs).ceil();
|
||||
|
||||
match content.grow_type() {
|
||||
GrowType::AutoHeight => {
|
||||
height = auto_height(¶graphs).ceil();
|
||||
}
|
||||
GrowType::AutoWidth => {
|
||||
width = auto_width(¶graphs).ceil();
|
||||
height = auto_height(¶graphs).ceil();
|
||||
}
|
||||
GrowType::Fixed => {}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue