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