mirror of
https://github.com/penpot/penpot.git
synced 2025-01-26 00:19:07 -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
|
||||
|
||||
(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
|
||||
[vid ids shape]
|
||||
(letfn [(gen-matrix [shape {scalex :x scaley :y}]
|
||||
(let [shape shape #_(rotate shape)]
|
||||
(case vid
|
||||
:top-left
|
||||
(-> (gmt/matrix)
|
||||
|
@ -131,7 +117,7 @@
|
|||
(gmt/scale scalex scaley)
|
||||
(gmt/translate (- (:x2 shape))
|
||||
(- (:y1 shape))))
|
||||
)))
|
||||
))
|
||||
|
||||
(calculate-ratio [orig-shape {:keys [width height] :as shape}]
|
||||
(let [result {:x (/ width (:width orig-shape))
|
||||
|
@ -237,14 +223,6 @@
|
|||
|
||||
;; --- 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
|
||||
{:mixins [mx/static]}
|
||||
[{:keys [x1 y1 width height] :as shape} zoom on-mouse-down]
|
||||
|
|
Loading…
Add table
Reference in a new issue