From 9f512abaebba0554a8c4548c67416eee24b3aa92 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 19 Jan 2016 18:16:28 +0200 Subject: [PATCH] Fix bug introduced in previous commit. --- src/uxbox/ui/workspace/selrect.cljs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/uxbox/ui/workspace/selrect.cljs b/src/uxbox/ui/workspace/selrect.cljs index 89c75ba34..e4e8b6906 100644 --- a/src/uxbox/ui/workspace/selrect.cljs +++ b/src/uxbox/ui/workspace/selrect.cljs @@ -48,20 +48,21 @@ (defn shapes-selrect-render [own shapes] - (let [[width height x y] (sh/group-size-and-position shapes)] - (html - [:g.controls - [:rect {:x x :y y :width width :height height - :style {:stroke "black" :fill "transparent" - :stroke-opacity "0.5"}}] - [:circle.top-left (merge default-selection-props - {:cx x :cy y})] - [:circle.top-right (merge default-selection-props - {:cx (+ x width) :cy y})] - [:circle.bottom-left (merge default-selection-props - {:cx x :cy (+ y height)})] - [:circle.bottom-right (merge default-selection-props - {:cx (+ x width) :cy (+ y height)})]]))) + (when (seq shapes) + (let [[width height x y] (sh/group-size-and-position shapes)] + (html + [:g.controls + [:rect {:x x :y y :width width :height height + :style {:stroke "black" :fill "transparent" + :stroke-opacity "0.5"}}] + [:circle.top-left (merge default-selection-props + {:cx x :cy y})] + [:circle.top-right (merge default-selection-props + {:cx (+ x width) :cy y})] + [:circle.bottom-left (merge default-selection-props + {:cx x :cy (+ y height)})] + [:circle.bottom-right (merge default-selection-props + {:cx (+ x width) :cy (+ y height)})]])))) (def ^:static shapes-selrect (mx/component