mirror of
https://github.com/penpot/penpot.git
synced 2025-06-19 12:21:40 +02:00
⚡ Add throttling to over-shapes-stream on viewport
This commit is contained in:
parent
ec1c1fcd2f
commit
a754d5ae3b
1 changed files with 13 additions and 12 deletions
|
@ -154,7 +154,7 @@
|
||||||
|
|
||||||
over-shapes-stream
|
over-shapes-stream
|
||||||
(mf/with-memo [move-stream mod-str]
|
(mf/with-memo [move-stream mod-str]
|
||||||
(rx/merge
|
(->> (rx/merge
|
||||||
;; This stream works to "refresh" the outlines when the control is pressed
|
;; This stream works to "refresh" the outlines when the control is pressed
|
||||||
;; but the mouse has not been moved from its position.
|
;; but the mouse has not been moved from its position.
|
||||||
(->> mod-str
|
(->> mod-str
|
||||||
|
@ -166,7 +166,8 @@
|
||||||
(->> move-stream
|
(->> move-stream
|
||||||
(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)))]
|
||||||
|
|
||||||
;; Refresh the refs on a value change
|
;; Refresh the refs on a value change
|
||||||
(mf/use-effect
|
(mf/use-effect
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue