0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-02 12:28:54 -05:00

🐛 Fix problem when selection shape while grid editing

This commit is contained in:
alonso.torres 2023-12-04 12:03:17 +01:00 committed by Andrey Antukh
parent f3cd384e8e
commit 10324b13ca
3 changed files with 13 additions and 10 deletions

View file

@ -261,15 +261,17 @@
(make-rect minx miny (- maxx minx) (- maxy miny)))))) (make-rect minx miny (- maxx minx) (- maxy miny))))))
(defn center->rect (defn center->rect
[point w h] ([point size]
(when (some? point) (center->rect point size size))
(let [x (dm/get-prop point :x) ([point w h]
y (dm/get-prop point :y)] (when (some? point)
(when (d/num? x y w h) (let [x (dm/get-prop point :x)
(make-rect (- x (/ w 2)) y (dm/get-prop point :y)]
(- y (/ h 2)) (when (d/num? x y w h)
w (make-rect (- x (/ w 2))
h))))) (- y (/ h 2))
w
h))))))
(defn s= (defn s=
[a b] [a b]

View file

@ -141,6 +141,7 @@
objects (wsh/lookup-page-objects state page-id)] objects (wsh/lookup-page-objects state page-id)]
(rx/of (rx/of
(dwc/expand-all-parents [id] objects) (dwc/expand-all-parents [id] objects)
:interrupt
::dwsp/interrupt)))))) ::dwsp/interrupt))))))
(defn select-prev-shape (defn select-prev-shape

View file

@ -115,7 +115,7 @@
[:& bool-options] [:& bool-options]
(cond (cond
(d/not-empty? selected-cells) (and edit-grid? (d/not-empty? selected-cells))
[:& grid-cell/options [:& grid-cell/options
{:shape (get objects edition) {:shape (get objects edition)
:cells selected-cells}] :cells selected-cells}]