mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
Add default resize logic implementation for shapes.
This commit is contained in:
@@ -41,6 +41,10 @@
|
|||||||
dispatch-by-type
|
dispatch-by-type
|
||||||
:hierarchy #'+hierarchy+)
|
:hierarchy #'+hierarchy+)
|
||||||
|
|
||||||
|
(defmulti -resize
|
||||||
|
dispatch-by-type
|
||||||
|
:hierarchy #'+hierarchy+)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Implementation
|
;; Implementation
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
@@ -50,3 +54,9 @@
|
|||||||
(assoc shape
|
(assoc shape
|
||||||
:x (+ (:x shape) dx)
|
:x (+ (:x shape) dx)
|
||||||
:y (+ (:y shape) dy)))
|
:y (+ (:y shape) dy)))
|
||||||
|
|
||||||
|
(defmethod -resize ::shape
|
||||||
|
[shape {:keys [width height] :as opts}]
|
||||||
|
(assoc shape
|
||||||
|
:width width
|
||||||
|
:height height))
|
||||||
|
|||||||
Reference in New Issue
Block a user