mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🐛 Fix problem with grid layout wasm
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
use skia_safe::{self as skia};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::shapes::modifiers::common::GetBounds;
|
||||
|
||||
use crate::math::{Bounds, Matrix, Rect};
|
||||
use crate::shapes::modifiers::grid_layout::{calculate_tracks, create_cell_data};
|
||||
use crate::shapes::{modified_children_ids, Frame, Layout, Shape, StructureEntry, Type};
|
||||
@@ -22,7 +24,7 @@ pub fn render_overlay(
|
||||
return;
|
||||
};
|
||||
|
||||
let bounds = &HashMap::<Uuid, Bounds>::new();
|
||||
let bounds = &mut HashMap::<Uuid, Bounds>::new();
|
||||
|
||||
let shape = &mut shape.clone();
|
||||
if let Some(modifiers) = modifiers.get(&shape.id) {
|
||||
@@ -32,6 +34,18 @@ pub fn render_overlay(
|
||||
let layout_bounds = shape.bounds();
|
||||
let children = modified_children_ids(shape, structure.get(&shape.id), false);
|
||||
|
||||
for child_id in children.iter() {
|
||||
let Some(child) = shapes.get(child_id) else {
|
||||
continue;
|
||||
};
|
||||
|
||||
if let Some(modifier) = modifiers.get(child_id) {
|
||||
let mut b = bounds.find(child);
|
||||
b.transform_mut(modifier);
|
||||
bounds.insert(*child_id, b);
|
||||
}
|
||||
}
|
||||
|
||||
let column_tracks = calculate_tracks(
|
||||
true,
|
||||
shape,
|
||||
|
||||
Reference in New Issue
Block a user