Skip to content

Commit

Permalink
Resize performance fix: remove all hit targets after drag starts
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhanshuguptagit committed Jan 12, 2024
1 parent 2025430 commit f6634a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bean/ui/views/sheet.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,14 @@
(.off viewport "pointermove" on-drag-move)
(.off viewport "pointerup" on-drag-end)
(.off viewport "pointerleave" on-drag-end)
(set! (.-interactiveChildren g) true)
(let [y (pos-fn i2)
distance (- y start-y)
new-h (+ row-h distance)]
(when (pos? new-h)
(rf/dispatch [::events/resize-row row new-h]))
(.clear resizer-g)))]
(.destroy resizer-g)))]
(set! (.-interactiveChildren g) false)
(.addChild g resizer-g)
(draw-resizers start-y)
(.on viewport "pointermove" on-drag-move)
Expand Down Expand Up @@ -176,12 +178,14 @@
(.off viewport "pointermove" on-drag-move)
(.off viewport "pointerup" on-drag-end)
(.off viewport "pointerleave" on-drag-end)
(set! (.-interactiveChildren g) true)
(let [x (pos-fn i2)
distance (- x start-x)
new-w (+ col-w distance)]
(when (pos? new-w)
(rf/dispatch [::events/resize-col col new-w]))
(.clear resizer-g)))]
(.destroy resizer-g)))]
(set! (.-interactiveChildren g) false)
(.addChild g resizer-g)
(draw-resizers start-x)
(.on viewport "pointermove" on-drag-move)
Expand Down

0 comments on commit f6634a3

Please sign in to comment.