Skip to content

Commit

Permalink
LBTK: Fix corruption when clicking in blank space below items
Browse files Browse the repository at this point in the history
A flag was not preserved. Regressed in 4dc3386.
  • Loading branch information
inexorabletash committed Jan 10, 2025
1 parent c9dbaee commit 63c08c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions res/notes/testplan.md
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ Watch out for:
* Caret being placed in the wrong place by a click.
* Mispaint when cleared with Control+X (or Clear key on IIgs)

# List Boxes Controls
# List Box Controls

This covers:
* File Pickers
Expand Down Expand Up @@ -1395,7 +1395,6 @@ Repeat for each list box:
* Selects the last item.
* Hold down the mouse button on the scrollbar's up arrow or down arrow; verify that the scrolling continues as long as the button is held down.
* Click on an item. Verify it is selected. Click on white space below the items (if possible). Verify that selection is cleared.
* Hold the down arrow to scroll to the bottom of the list. Hold the up arrow to scroll to the top. Verify the correct items redraw.

For the Sounds DA:
* Click on an item. Verify it is selected, and plays the sound. Click on the same selected item. Verify it plays the sound again.
Expand Down
7 changes: 4 additions & 3 deletions toolkits/lbtk.s
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,8 @@ new_selection .byte
pha ; A = new selection
lda lbr_copy + LBTK::ListBoxRecord::selected_index
jsr _HighlightIndex
pla ; A = new selection
ldy #LBTK::ListBoxRecord::selected_index
pla ; A = new selection
sta (lbr_ptr),y
sta lbr_copy + LBTK::ListBoxRecord::selected_index ; keep copy in sync
bmi :+
Expand Down Expand Up @@ -710,6 +710,8 @@ update:
lda lbr_copy + LBTK::ListBoxRecord::num_items
beq finish

index := tmp_point + .sizeof(MGTK::Point)

lda lbr_copy + LBTK::ListBoxRecord::num_rows
sta rows
ldy #MGTK::Winfo::vthumbpos
Expand All @@ -723,8 +725,7 @@ update:
loop:
MGTK_CALL MGTK::MoveTo, tmp_point

index := *+1
lda #SELF_MODIFIED_BYTE
lda index
ldxy #tmp_point
jsr DrawEntryProc

Expand Down

0 comments on commit 63c08c6

Please sign in to comment.