From df08ed6dd258d69aba5033ca9203f3b22b225353 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 29 Jan 2016 00:09:36 +0200 Subject: [PATCH] Fix selrect position for group of lines. --- src/uxbox/shapes.cljs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/uxbox/shapes.cljs b/src/uxbox/shapes.cljs index 0a8815a79c..8eca6ddb42 100644 --- a/src/uxbox/shapes.cljs +++ b/src/uxbox/shapes.cljs @@ -160,11 +160,14 @@ (container-rect $)))) (defmethod -outer-rect :builtin/line - [shape] - (let [{:keys [x1 y1 x2 y2]} shape - props {:x x1 :y y1 :width (- x2 x1) :height (- y2 y1)} - shape (merge shape props)] - (container-rect shape))) + [{:keys [x1 y1 x2 y2 group] :as shape}] + (let [group (get-in @st/state [:shapes-by-id group]) + props {:x (+ x1 (:dx group 0)) + :y (+ y1 (:dy group 0)) + :width (- x2 x1) + :height (- y2 y1)}] + (-> (merge shape props) + (container-rect)))) (defmethod -outer-rect :builtin/group [{:keys [id group rotation dx dy] :as shape}]