mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 15:26:10 +02:00
Move selrect into separate ns and rename it to mouse-selrect.
This commit is contained in:
parent
89cc964f54
commit
d5bc6bb16a
2 changed files with 31 additions and 21 deletions
|
@ -16,6 +16,7 @@
|
|||
[uxbox.ui.mixins :as mx]
|
||||
[uxbox.ui.dom :as dom]
|
||||
[uxbox.ui.workspace.base :as wb]
|
||||
[uxbox.ui.workspace.selrect :refer (mouse-selrect)]
|
||||
[uxbox.ui.workspace.grid :refer (grid)]
|
||||
[uxbox.ui.workspace.options :refer (element-opts)])
|
||||
(:import goog.events.EventType))
|
||||
|
@ -44,27 +45,6 @@
|
|||
:name "background"
|
||||
:mixins [mx/static]}))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Select Rect
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn selrect-render
|
||||
[own]
|
||||
(when-let [data (rum/react wb/selrect-pos)]
|
||||
(let [{:keys [x y width height]} (wb/selrect->rect data)]
|
||||
(html
|
||||
[:rect.selection-rect
|
||||
{:x x
|
||||
:y y
|
||||
:width width
|
||||
:height height}]))))
|
||||
|
||||
(def ^:static selrect
|
||||
(mx/component
|
||||
{:render selrect-render
|
||||
:name "selrect"
|
||||
:mixins [mx/static rum/reactive]}))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Selected shapes.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue