mirror of
https://github.com/penpot/penpot.git
synced 2026-02-12 22:53:02 +00:00
🐛 Fix resize group
This commit is contained in:
@@ -379,8 +379,22 @@ pub fn propagate_modifiers(
|
||||
modifiers: &[TransformEntry],
|
||||
pixel_precision: bool,
|
||||
) -> Vec<TransformEntry> {
|
||||
// Ids of all shapes that have an entry in the incoming modifiers list.
|
||||
let modifier_ids: HashSet<Uuid> = modifiers.iter().map(|e| e.id).collect();
|
||||
let mut entries: VecDeque<_> = modifiers
|
||||
.iter()
|
||||
.filter(|entry| {
|
||||
// Skip child shapes whose parent is also in the modifiers list.
|
||||
// Those children will get their transform when the parent's transform
|
||||
// is propagated via propagate_children; including them here would
|
||||
// cause the transform to be applied twice (once here, once from parent).
|
||||
let should_skip = state
|
||||
.shapes
|
||||
.get(&entry.id)
|
||||
.and_then(|s| s.parent_id.map(|pid| modifier_ids.contains(&pid)))
|
||||
.unwrap_or(false);
|
||||
!should_skip
|
||||
})
|
||||
.map(|entry| {
|
||||
// If we receibe a identity matrix we force a reflow
|
||||
if math::identitish(&entry.transform) {
|
||||
@@ -423,7 +437,6 @@ pub fn propagate_modifiers(
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
for id in layout_reflows.iter() {
|
||||
if reflown.contains(id) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user