mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🔧 Improve text tiles intersection on changes
This commit is contained in:
committed by
Alonso Torres
parent
f795f20ef8
commit
a51fd009bc
@@ -266,6 +266,7 @@ impl Shape {
|
||||
self.invalidate_extrect();
|
||||
self.selrect.set_ltrb(left, top, right, bottom);
|
||||
if let Type::Text(ref mut text) = self.shape_type {
|
||||
text.update_layout(self.selrect);
|
||||
text.set_xywh(left, top, right - left, bottom - top);
|
||||
}
|
||||
}
|
||||
@@ -832,7 +833,8 @@ impl Shape {
|
||||
shape.bounds().to_rect()
|
||||
}
|
||||
Type::Text(text_content) => {
|
||||
let text_bounds = text_content.get_bounds(&shape);
|
||||
// FIXME: we need to recalculate the text bounds here because the shape's selrect
|
||||
let text_bounds = text_content.calculate_bounds(&shape);
|
||||
text_bounds.to_rect()
|
||||
}
|
||||
_ => shape.bounds().to_rect(),
|
||||
|
||||
Reference in New Issue
Block a user