Scrolling fixes

- Fixed window titles rendering in wrong coordinate space
- Fixed superfluous redrawing caused by scroll arrow clicking
This commit is contained in:
Quinn Dunki 2015-02-03 13:11:22 -08:00
parent 7feec071c1
commit 0c12da7c89
3 changed files with 25 additions and 8 deletions

31
views.s
View File

@ -465,10 +465,12 @@ paintWindowTitle_compute:
lsr
sec
sbc SCRATCH1
sta WG_LOCALCURSORX ; Position cursor
lda #-1
sta WG_LOCALCURSORY
jsr WGSyncGlobalCursor
clc
adc WG_VIEWRECORDS+0,y
sta WG_CURSORX ; Position cursor
lda WG_VIEWRECORDS+1,y
dec
sta WG_CURSORY
ldy #0
paintWindowTitleLoop:
@ -592,6 +594,21 @@ WGViewFocus:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGViewFocusQuiet
; Shifts focus to the selected view without redrawing anything
; Side effects: Changes selected view, repaints some views
;
WGViewFocusQuiet:
pha
lda WG_ACTIVEVIEW ; Stash current selection
sta WG_FOCUSVIEW ; Focus on our current selection
pla
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGViewUnfocus
; Unfocuses all views
@ -878,21 +895,21 @@ WGPendingViewAction_done: ; Located here for branch range
WGPendingViewAction_up:
lda #1 ; Up arrow
jsr WGScrollYBy
jsr WGViewFocus
jsr WGViewFocusQuiet
jsr WGViewFocusAction ; Trigger application to redraw contents
bra WGPendingViewAction_done
WGPendingViewAction_down:
lda #-1 ; Down arrow
jsr WGScrollYBy
jsr WGViewFocus
jsr WGViewFocusQuiet
jsr WGViewFocusAction ; Trigger application to redraw contents
bra WGPendingViewAction_done
WGPendingViewAction_left:
lda #1 ; Left arrow
jsr WGScrollXBy
jsr WGViewFocus
jsr WGViewFocusQuiet
jsr WGViewFocusAction ; Trigger application to redraw contents
bra WGPendingViewAction_done

Binary file not shown.

View File

@ -64,7 +64,7 @@ WGEntryPointTable:
.addr WGViewFocusPrev
.addr WGViewFocusAction
.addr WGPendingViewAction
.addr WGPendingView
.addr WGPendingClick
.addr WGScrollX
.addr WGScrollXBy
.addr WGScrollY