0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-14 16:01:24 -05:00

Comment not used code at this moment.

This commit is contained in:
Andrey Antukh 2016-04-20 20:43:49 +03:00
parent 8db39822ff
commit 8c99683eaf
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -39,52 +39,52 @@
;; Circle Handlers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn- handlers-render
[own shape]
(letfn [(on-mouse-down [vid event]
(dom/stop-propagation event)
(uuc/acquire-action! "ui.shape.resize"
{:vid vid :shape (:id shape)}))
;; (defn- handlers-render
;; [own shape]
;; (letfn [(on-mouse-down [vid event]
;; (dom/stop-propagation event)
;; (uuc/acquire-action! "ui.shape.resize"
;; {:vid vid :shape (:id shape)}))
(on-mouse-up [vid event]
(dom/stop-propagation event)
(uuc/release-action! "ui.shape.resize"))]
(let [{:keys [x y width height]} (geom/outer-rect shape)]
(html
[:g.controls
[:rect {:x x :y y :width width :height height :stroke-dasharray "5,5"
:style {:stroke "#333" :fill "transparent"
:stroke-opacity "1"}}]
[:circle.top-left
(merge uusc/+circle-props+
{:on-mouse-up #(on-mouse-up 1 %)
:on-mouse-down #(on-mouse-down 1 %)
:cx x
:cy y})]
[:circle.top-right
(merge uusc/+circle-props+
{:on-mouse-up #(on-mouse-up 2 %)
:on-mouse-down #(on-mouse-down 2 %)
:cx (+ x width)
:cy y})]
[:circle.bottom-left
(merge uusc/+circle-props+
{:on-mouse-up #(on-mouse-up 3 %)
:on-mouse-down #(on-mouse-down 3 %)
:cx x
:cy (+ y height)})]
[:circle.bottom-right
(merge uusc/+circle-props+
{:on-mouse-up #(on-mouse-up 4 %)
:on-mouse-down #(on-mouse-down 4 %)
:cx (+ x width)
:cy (+ y height)})]]))))
;; (on-mouse-up [vid event]
;; (dom/stop-propagation event)
;; (uuc/release-action! "ui.shape.resize"))]
;; (let [{:keys [x y width height]} (geom/outer-rect shape)]
;; (html
;; [:g.controls
;; [:rect {:x x :y y :width width :height height :stroke-dasharray "5,5"
;; :style {:stroke "#333" :fill "transparent"
;; :stroke-opacity "1"}}]
;; [:circle.top-left
;; (merge uusc/+circle-props+
;; {:on-mouse-up #(on-mouse-up 1 %)
;; :on-mouse-down #(on-mouse-down 1 %)
;; :cx x
;; :cy y})]
;; [:circle.top-right
;; (merge uusc/+circle-props+
;; {:on-mouse-up #(on-mouse-up 2 %)
;; :on-mouse-down #(on-mouse-down 2 %)
;; :cx (+ x width)
;; :cy y})]
;; [:circle.bottom-left
;; (merge uusc/+circle-props+
;; {:on-mouse-up #(on-mouse-up 3 %)
;; :on-mouse-down #(on-mouse-down 3 %)
;; :cx x
;; :cy (+ y height)})]
;; [:circle.bottom-right
;; (merge uusc/+circle-props+
;; {:on-mouse-up #(on-mouse-up 4 %)
;; :on-mouse-down #(on-mouse-down 4 %)
;; :cx (+ x width)
;; :cy (+ y height)})]]))))
(def ^:const handlers
(mx/component
{:render handlers-render
:name "handlers"
:mixins [mx/static]}))
;; (def ^:const handlers
;; (mx/component
;; {:render handlers-render
;; :name "handlers"
;; :mixins [mx/static]}))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Shape