mirror of
https://github.com/penpot/penpot.git
synced 2025-02-11 01:28:30 -05:00
🐛 Improved response time of over shapes
This commit is contained in:
parent
b943a034c9
commit
fff98b995f
1 changed files with 12 additions and 3 deletions
|
@ -167,7 +167,11 @@
|
||||||
(rx/tap #(reset! last-point-ref %))
|
(rx/tap #(reset! last-point-ref %))
|
||||||
;; When transforming shapes we stop querying the worker
|
;; When transforming shapes we stop querying the worker
|
||||||
(rx/merge-map query-point)))
|
(rx/merge-map query-point)))
|
||||||
(rx/throttle 100)))]
|
|
||||||
|
(rx/share)))
|
||||||
|
|
||||||
|
over-shapes-stream-debounced
|
||||||
|
(->> over-shapes-stream (rx/debounce 50))]
|
||||||
|
|
||||||
;; Refresh the refs on a value change
|
;; Refresh the refs on a value change
|
||||||
(mf/use-effect
|
(mf/use-effect
|
||||||
|
@ -196,6 +200,12 @@
|
||||||
(mf/deps focus)
|
(mf/deps focus)
|
||||||
#(mf/set-ref-val! focus-ref focus))
|
#(mf/set-ref-val! focus-ref focus))
|
||||||
|
|
||||||
|
(hooks/use-stream
|
||||||
|
over-shapes-stream-debounced
|
||||||
|
(mf/deps objects)
|
||||||
|
(fn [_]
|
||||||
|
(reset! hover-top-frame-id (ctt/top-nested-frame objects (deref last-point-ref)))))
|
||||||
|
|
||||||
(hooks/use-stream
|
(hooks/use-stream
|
||||||
over-shapes-stream
|
over-shapes-stream
|
||||||
(mf/deps page-id objects show-measures?)
|
(mf/deps page-id objects show-measures?)
|
||||||
|
@ -255,8 +265,7 @@
|
||||||
(get objects))]
|
(get objects))]
|
||||||
|
|
||||||
(reset! hover hover-shape)
|
(reset! hover hover-shape)
|
||||||
(reset! hover-ids ids)
|
(reset! hover-ids ids))))))
|
||||||
(reset! hover-top-frame-id (ctt/top-nested-frame objects (deref last-point-ref))))))))
|
|
||||||
|
|
||||||
(defn setup-viewport-modifiers
|
(defn setup-viewport-modifiers
|
||||||
[modifiers objects]
|
[modifiers objects]
|
||||||
|
|
Loading…
Add table
Reference in a new issue