mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 21:09:00 -05:00
Remove dead code from shapes selection ns.
This commit is contained in:
parent
d28e0abe38
commit
d57a71b8d6
1 changed files with 58 additions and 80 deletions
|
@ -50,23 +50,9 @@
|
||||||
|
|
||||||
;; --- Resize Implementation
|
;; --- Resize Implementation
|
||||||
|
|
||||||
(defn- rotate
|
|
||||||
[shape]
|
|
||||||
(let [{:keys [x1 y1 width height rotation]} (-> (geom/shape->rect-shape shape)
|
|
||||||
(assoc :type :rect)
|
|
||||||
(geom/size))
|
|
||||||
x-center (+ x1 (/ width 2))
|
|
||||||
y-center (+ y1 (/ height 2))
|
|
||||||
mt (-> (gmt/matrix)
|
|
||||||
(gmt/translate x-center y-center)
|
|
||||||
(gmt/rotate rotation)
|
|
||||||
(gmt/translate (- x-center) (- y-center)))]
|
|
||||||
(geom/transform shape mt)))
|
|
||||||
|
|
||||||
(defn- start-resize
|
(defn- start-resize
|
||||||
[vid ids shape]
|
[vid ids shape]
|
||||||
(letfn [(gen-matrix [shape {scalex :x scaley :y}]
|
(letfn [(gen-matrix [shape {scalex :x scaley :y}]
|
||||||
(let [shape shape #_(rotate shape)]
|
|
||||||
(case vid
|
(case vid
|
||||||
:top-left
|
:top-left
|
||||||
(-> (gmt/matrix)
|
(-> (gmt/matrix)
|
||||||
|
@ -131,7 +117,7 @@
|
||||||
(gmt/scale scalex scaley)
|
(gmt/scale scalex scaley)
|
||||||
(gmt/translate (- (:x2 shape))
|
(gmt/translate (- (:x2 shape))
|
||||||
(- (:y1 shape))))
|
(- (:y1 shape))))
|
||||||
)))
|
))
|
||||||
|
|
||||||
(calculate-ratio [orig-shape {:keys [width height] :as shape}]
|
(calculate-ratio [orig-shape {:keys [width height] :as shape}]
|
||||||
(let [result {:x (/ width (:width orig-shape))
|
(let [result {:x (/ width (:width orig-shape))
|
||||||
|
@ -237,14 +223,6 @@
|
||||||
|
|
||||||
;; --- Controls (Component)
|
;; --- Controls (Component)
|
||||||
|
|
||||||
(defn selection-rect
|
|
||||||
[{:keys [x1 y1 x2 y2 width height rotation] :as shape}]
|
|
||||||
{:x x1
|
|
||||||
:y y1
|
|
||||||
:rotation rotation
|
|
||||||
:width width
|
|
||||||
:height height})
|
|
||||||
|
|
||||||
(mx/defc controls
|
(mx/defc controls
|
||||||
{:mixins [mx/static]}
|
{:mixins [mx/static]}
|
||||||
[{:keys [x1 y1 width height] :as shape} zoom on-mouse-down]
|
[{:keys [x1 y1 width height] :as shape} zoom on-mouse-down]
|
||||||
|
|
Loading…
Add table
Reference in a new issue