Fixed selection positioning with neested groups.

This commit is contained in:
Andrey Antukh 2016-01-30 13:50:37 +02:00
parent 17597ced08
commit 1f22b424f5

View file

@ -255,9 +255,14 @@
y' (apply max (map (fn [{:keys [y height]}] (+ y height)) shapes)) y' (apply max (map (fn [{:keys [y height]}] (+ y height)) shapes))
width (- x' x) width (- x' x)
height (- y' y)] height (- y' y)]
(as-> shape $ (let [group (get-in @st/state [:shapes-by-id group])]
(merge $ {:width width :height height :x x :y y}) (as-> shape $
(container-rect $)))) (merge $ {:width width
:height height
:x (+ x (or (:dx group) 0))
:y (+ y (or (:dy group) 0))
})
(container-rect $)))))
(defmethod -outer-rect :default (defmethod -outer-rect :default
[shape _] [shape _]