restyle shape selected controls

This commit is contained in:
elhombretecla 2016-05-18 16:57:26 +02:00
parent 94e23400c3
commit eabfa50142
2 changed files with 27 additions and 35 deletions

View file

@ -11,12 +11,12 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(def ^:const +circle-props+ (def ^:const +circle-props+
{:r 5 {:r 6
:style {:fillOpacity "0.5" :style {:fillOpacity "1"
:strokeWidth "1px" :strokeWidth "1px"
:vectorEffect "non-scaling-stroke"} :vectorEffect "non-scaling-stroke"}
:fill "#333" :fill "#78dbbe"
:stroke "#333"}) :stroke "#3f9d81"})
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation Api ;; Implementation Api

View file

@ -52,38 +52,30 @@
[:g.controls [:g.controls
[:rect.main {:x x :y y :width width :height height :stroke-dasharray "5,5" [:rect.main {:x x :y y :width width :height height :stroke-dasharray "5,5"
:style {:stroke "#333" :fill "transparent" :stroke-opacity "1"}}] :style {:stroke "#333" :fill "transparent" :stroke-opacity "1"}}]
[:rect.top [:circle.top
{:fill "#333" (merge uusc/+circle-props+
:on-mouse-up #(on-mouse-up 5 %) {:on-mouse-up #(on-mouse-up 5 %)
:on-mouse-down #(on-mouse-down 5 %) :on-mouse-down #(on-mouse-down 5 %)
:x (- (+ x (/ width 2)) 7) :cx (+ x (/ width 2))
:width 14 :cy (- y 2)})]
:height 3 [:circle.right
:y (- y 5)}] (merge uusc/+circle-props+
[:rect.right {:on-mouse-up #(on-mouse-up 6 %)
{:fill "#333" :on-mouse-down #(on-mouse-down 6 %)
:on-mouse-up #(on-mouse-up 6 %) :cy (+ y (/ height 2))
:on-mouse-down #(on-mouse-down 6 %) :cx (+ x width 1)})]
:y (- (+ y (/ height 2)) 7) [:circle.bottom
:width 3 (merge uusc/+circle-props+
:height 14 {:on-mouse-up #(on-mouse-up 7 %)
:x (+ x width 2)}] :on-mouse-down #(on-mouse-down 7 %)
[:rect.bottom :cx (+ x (/ width 2))
{:fill "#333" :cy (+ y height 2)})]
:on-mouse-up #(on-mouse-up 7 %) [:circle.left
:on-mouse-down #(on-mouse-down 7 %) (merge uusc/+circle-props+
:x (- (+ x (/ width 2)) 7) {:on-mouse-up #(on-mouse-up 8 %)
:width 14 :on-mouse-down #(on-mouse-down 8 %)
:height 3 :cy (+ y (/ height 2))
:y (+ y height 2)}] :cx (- x 3)})]
[:rect.left
{:fill "#333"
:on-mouse-up #(on-mouse-up 8 %)
:on-mouse-down #(on-mouse-down 8 %)
:y (- (+ y (/ height 2)) 7)
:width 3
:height 14
:x (- x 5)}]
[:circle.top-left [:circle.top-left
(merge uusc/+circle-props+ (merge uusc/+circle-props+
{:on-mouse-up #(on-mouse-up 1 %) {:on-mouse-up #(on-mouse-up 1 %)