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 lsr
sec sec
sbc SCRATCH1 sbc SCRATCH1
sta WG_LOCALCURSORX ; Position cursor clc
lda #-1 adc WG_VIEWRECORDS+0,y
sta WG_LOCALCURSORY sta WG_CURSORX ; Position cursor
jsr WGSyncGlobalCursor lda WG_VIEWRECORDS+1,y
dec
sta WG_CURSORY
ldy #0 ldy #0
paintWindowTitleLoop: paintWindowTitleLoop:
@ -592,6 +594,21 @@ WGViewFocus:
rts 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 ; WGViewUnfocus
; Unfocuses all views ; Unfocuses all views
@ -878,21 +895,21 @@ WGPendingViewAction_done: ; Located here for branch range
WGPendingViewAction_up: WGPendingViewAction_up:
lda #1 ; Up arrow lda #1 ; Up arrow
jsr WGScrollYBy jsr WGScrollYBy
jsr WGViewFocus jsr WGViewFocusQuiet
jsr WGViewFocusAction ; Trigger application to redraw contents jsr WGViewFocusAction ; Trigger application to redraw contents
bra WGPendingViewAction_done bra WGPendingViewAction_done
WGPendingViewAction_down: WGPendingViewAction_down:
lda #-1 ; Down arrow lda #-1 ; Down arrow
jsr WGScrollYBy jsr WGScrollYBy
jsr WGViewFocus jsr WGViewFocusQuiet
jsr WGViewFocusAction ; Trigger application to redraw contents jsr WGViewFocusAction ; Trigger application to redraw contents
bra WGPendingViewAction_done bra WGPendingViewAction_done
WGPendingViewAction_left: WGPendingViewAction_left:
lda #1 ; Left arrow lda #1 ; Left arrow
jsr WGScrollXBy jsr WGScrollXBy
jsr WGViewFocus jsr WGViewFocusQuiet
jsr WGViewFocusAction ; Trigger application to redraw contents jsr WGViewFocusAction ; Trigger application to redraw contents
bra WGPendingViewAction_done bra WGPendingViewAction_done

Binary file not shown.

View File

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