mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 21:11:38 +02:00
⚡ Add micro optimization to handle-area-selection event impl
This commit is contained in:
parent
23d358aea7
commit
819c7ea814
1 changed files with 7 additions and 6 deletions
|
@ -15,6 +15,7 @@
|
||||||
[app.common.pages.changes-builder :as pcb]
|
[app.common.pages.changes-builder :as pcb]
|
||||||
[app.common.pages.focus :as cpf]
|
[app.common.pages.focus :as cpf]
|
||||||
[app.common.pages.helpers :as cph]
|
[app.common.pages.helpers :as cph]
|
||||||
|
[app.common.record :as cr]
|
||||||
[app.common.types.component :as ctk]
|
[app.common.types.component :as ctk]
|
||||||
[app.common.types.file :as ctf]
|
[app.common.types.file :as ctf]
|
||||||
[app.common.types.page :as ctp]
|
[app.common.types.page :as ctp]
|
||||||
|
@ -68,15 +69,15 @@
|
||||||
|
|
||||||
calculate-selrect
|
calculate-selrect
|
||||||
(fn [selrect [delta space?]]
|
(fn [selrect [delta space?]]
|
||||||
(let [selrect (-> selrect
|
(let [selrect (-> (cr/clone selrect)
|
||||||
(update :x2 + (:x delta))
|
(cr/update! :x2 + (:x delta))
|
||||||
(update :y2 + (:y delta)))
|
(cr/update! :y2 + (:y delta)))
|
||||||
selrect (if ^boolean space?
|
selrect (if ^boolean space?
|
||||||
(-> selrect
|
(-> selrect
|
||||||
(update :x1 + (:x delta))
|
(cr/update! :x1 + (:x delta))
|
||||||
(update :y1 + (:y delta)))
|
(cr/update! :y1 + (:y delta)))
|
||||||
selrect)]
|
selrect)]
|
||||||
(grc/update-rect selrect :corners)))
|
(grc/update-rect! selrect :corners)))
|
||||||
|
|
||||||
selrect-stream
|
selrect-stream
|
||||||
(->> ms/mouse-position
|
(->> ms/mouse-position
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue