mirror of
https://github.com/penpot/penpot.git
synced 2025-01-25 07:58:49 -05:00
Merge pull request #3620 from penpot/alotor-fix-over-shapes
🐛 Improved response time of over shapes
This commit is contained in:
commit
34ddc00c8e
1 changed files with 12 additions and 3 deletions
|
@ -168,7 +168,11 @@
|
|||
(rx/tap #(reset! last-point-ref %))
|
||||
;; When transforming shapes we stop querying the worker
|
||||
(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
|
||||
(mf/use-effect
|
||||
|
@ -197,6 +201,12 @@
|
|||
(mf/deps 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
|
||||
over-shapes-stream
|
||||
(mf/deps page-id objects show-measures?)
|
||||
|
@ -256,8 +266,7 @@
|
|||
(get objects))]
|
||||
|
||||
(reset! hover hover-shape)
|
||||
(reset! hover-ids ids)
|
||||
(reset! hover-top-frame-id (ctt/top-nested-frame objects (deref last-point-ref))))))))
|
||||
(reset! hover-ids ids))))))
|
||||
|
||||
(defn setup-viewport-modifiers
|
||||
[modifiers objects]
|
||||
|
|
Loading…
Add table
Reference in a new issue