mirror of
https://github.com/penpot/penpot.git
synced 2026-11-29 06:30:33 +00:00
⚡ Build gap overlay bounds from the flex board's shapes only (#13389)
The flex gap overlay built a lazy map over every object on the page on each render. It re-renders on every viewport change, so with a flex board selected panning became very slow, e.g. on the mem_benchmark file. The layout calculation only needs to look up the frame and its desendants, so limit it to just that subtree. Panning a page of 50k shapes goes from ~30fps -> 60fps. AI-assisted-by: claude-opus-5-5
This commit is contained in:
parent
04e3b73c2d
commit
1cbb532eff
@ -208,7 +208,8 @@
|
||||
wrap-blocks
|
||||
(let [block-children (->> children
|
||||
(map #(vector (gpo/parent-coords-bounds (:points %) (:points frame)) %)))
|
||||
bounds (d/lazy-map (keys objects) #(gsh/shape->points (get objects %)))
|
||||
bounds (d/lazy-map (cfh/get-children-ids-with-self objects frame-id)
|
||||
#(gsh/shape->points (get objects %)))
|
||||
|
||||
layout-data (gsl/calc-layout-data frame (:points frame) block-children bounds objects)
|
||||
layout-bounds (:layout-bounds layout-data)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user