mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
⚡ Reduce allocation on translate-*-frame functions
This commit is contained in:
parent
121188d921
commit
1ddea076e3
1 changed files with 7 additions and 5 deletions
|
@ -22,14 +22,16 @@
|
|||
|
||||
;; --- Outer Rect
|
||||
|
||||
|
||||
(defn translate-to-frame
|
||||
[shape {:keys [x y]}]
|
||||
(gtr/move shape (gpt/negate (gpt/point x y))) )
|
||||
[shape frame]
|
||||
(->> (gpt/point (- (dm/get-prop frame :x))
|
||||
(- (dm/get-prop frame :y)))
|
||||
(gtr/move shape)))
|
||||
|
||||
(defn translate-from-frame
|
||||
[shape {:keys [x y]}]
|
||||
(gtr/move shape (gpt/point x y)) )
|
||||
[shape frame]
|
||||
(gtr/move shape (gpt/point (dm/get-prop frame :x)
|
||||
(dm/get-prop frame :y))))
|
||||
|
||||
(defn shape->rect
|
||||
[shape]
|
||||
|
|
Loading…
Reference in a new issue