diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index e073d452..64e82473 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -17,6 +17,7 @@ Project Page: https://github.com/a2stuff/a2d * Added Dutch (`nl`) localization. ([#767](https://github.com/a2stuff/a2d/issues/767)) * Improve sound played when entering/exiting Mouse Keys mode. * Improve window title bar apperance. +* Prevent scrollbar thumb jumping when not moved. ([#778](https://github.com/a2stuff/a2d/issues/778)) ### Launcher * If starting from a folder, brand it as a system folder. diff --git a/mgtk/mgtk.s b/mgtk/mgtk.s index 86020b75..2e923bd8 100644 --- a/mgtk/mgtk.s +++ b/mgtk/mgtk.s @@ -9318,6 +9318,19 @@ got_ctl:lda params::which_ctl EXIT_CALL MGTK::Error::no_active_window : jsr GetThumbRect + + ;; Stash initial position, to detect no-op + initial_pos := $8A + + ldx #0 + bit which_control + bpl :+ + ldx #2 +: lda winrect,x + sta initial_pos + lda winrect+1,x + sta initial_pos+1 + jsr SaveParamsAndStack jsr SetDesktopPort @@ -9397,6 +9410,21 @@ drag_done: jsr FrameWinRect jsr ShowCursorAndRestore + ;; Did position change? + ldx #0 + bit which_control + bpl :+ + ldx #2 +: lda winrect,x + cmp initial_pos + bne :+ + lda winrect+1,x + cmp initial_pos+1 + bne :+ + lda thumb_pos ; (out) thumbpos = original value + ldx #0 ; (out) thumbmoved = 0 + beq store ; always +: jsr SetUpThumbDivision jsr FixedDiv @@ -9411,13 +9439,10 @@ drag_done: ldx fixed_div_quotient+1 ; 0.8 fractional part jsr GetThumbCoord - -: ldx #1 - cmp fixed_div_quotient+2 - bne :+ - dex - -: ldy #params::thumbpos - params +: + ldx #1 ; (out) thumbmoved +store: + ldy #params::thumbpos - params jmp store_xa_at_y .endproc ; TrackThumbImpl diff --git a/res/notes/testplan.md b/res/notes/testplan.md index 4f7ce902..0d4fbec4 100644 --- a/res/notes/testplan.md +++ b/res/notes/testplan.md @@ -763,13 +763,13 @@ Text File: * Verify that Solid-Apple plus Up/Down Arrow keys scroll by page. * Verify that Open-Apple plus Solid-Apple plus Up/Down Arrow keys scroll to start/end. * Click the Proportional/Fixed button on the title bar. Verify that the view is scrolled to the top. + * Scroll somewhere in the file. Click the scrollbar thumb without moving it. Verify the thumb doesn't move and the content doesn't scroll. * Preview a long text file, e.g. 2000 lines. Verify that dragging the scroll thumb to the middle shows approximately the middle of the file. * Preview a long text file, e.g. 2000 lines. Verify that Up/Down Arrow keys scroll by one line consistently. * Preview a text file with a tab character in the first line. Verify that the file displays all lines correctly. * Preview a long text file. Verify that the first page of content appears immediately, and that the watch cursor is shown while the rest of the file is parsed. With any acceleration disabled, use Open-Apple+Solid-Apple+Down to jump to the bottom of the file. Verify that the view is displayed without undue delay. * Download SUDOKU.dsk from www.michaeljmahon.com/Sudoku.html and mount it. Open the SUDOKU.STORY text file. Click on "Proportional" to change to "Fixed" font. Scroll down using down arrow key until bottom line reads "with". Scroll down again using down arrow key. Verify that the file correctly scrolled down one line. Scroll to the bottom of the file. Ensure the entire file is visible. - Image File: * Verify that Escape key exits. * Verify that Apple+W exits.