0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-16 01:31:22 -05:00

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+
{:r 5
:style {:fillOpacity "0.5"
{:r 6
:style {:fillOpacity "1"
:strokeWidth "1px"
:vectorEffect "non-scaling-stroke"}
:fill "#333"
:stroke "#333"})
:fill "#78dbbe"
:stroke "#3f9d81"})
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation Api

View file

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