Commit ef8757e
Skip ghost band on empty-space click to remove MouseUp jiggle
The optimistic ghost paints the band at the cursor's exact Y, but
the editor's actual scroll lands at a line-snapped offset
(floor(scrollOffset / lineHeight)), so the eventual settled band
position is up to barHeight/totalLines away from the ghost. During
drag that mismatch is invisible because the cursor is moving; on a
stationary empty-space click it shows up as a one-pixel-to-many-
pixel jiggle the moment the ghost clears on MouseUp.
Fix: in OnMouseLeftButtonDown's empty-space branch, send the scroll
request directly without setting _dragGhostBandTop. The natural
ViewportState propagation (editor scrolls -> layout -> ScrollChanged
-> Viewport update -> bar invalidate -> repaint) lands the band at
its actual settled position on the next frame, which is exactly
where MouseUp will leave it. No ghost = no jiggle.
If a drag follows the click, the first MouseMove activates the
ghost via EmitDragScroll on the existing smooth-drag path. The
brief transition from natural-position-band to ghost-at-cursor is
masked by ongoing motion.
The band-grab drag case still ends with a line-snap mismatch on
MouseUp, but it's masked by the motion of the drag itself; the
user hasn't reported it as jiggle.
AI-Local-Session: b53d5fe5-38cc-41dd-b987-3def5ef3f0d3
AI-Cloud-Session: 744dd836-01e5-48af-91db-daa8241a01d7
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 5d3157f commit ef8757e
2 files changed
Lines changed: 29 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
375 | 386 | | |
376 | 387 | | |
377 | 388 | | |
| |||
382 | 393 | | |
383 | 394 | | |
384 | 395 | | |
385 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
386 | 399 | | |
387 | 400 | | |
388 | 401 | | |
| |||
0 commit comments