mirror of
https://github.com/penpot/penpot.git
synced 2026-04-27 04:08:23 +00:00
⚡ Reduce allocation on translate-*-frame functions
This commit is contained in:
parent
121188d921
commit
1ddea076e3
@ -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…
x
Reference in New Issue
Block a user