Skip to content

Commit

Permalink
MGTK: Fix title bar stripes when using 8px font
Browse files Browse the repository at this point in the history
The commit 258ecee tweaked the title bar appearance, but it only
accounted for the standard 9px tall system font, and that was pure
luck. With an 8px tall font the stripes were drawn differently to the
left and right of the "go away" box.

Fix this properly. This only affects custom builds that use a
different font.

There is a picture of the bad title bars in this comment, but you need
to look closely since there's a menu in the way:
#793 (comment)
  • Loading branch information
inexorabletash committed May 5, 2024
1 parent b029b89 commit c4392c0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mgtk/mgtk.s
Original file line number Diff line number Diff line change
Expand Up @@ -7554,8 +7554,12 @@ stripes_pattern_alt := *+1
.byte %00000000
.byte %11111111

;;; Also sets `top` and `bottom` using "go away" rect
.proc SetStripesPattern
jsr GetWinGoAwayRect
copy16 winrect::y1, top
copy16 winrect::y2, bottom

lda winrect::y1
and #1
beq :+
Expand Down Expand Up @@ -7590,7 +7594,7 @@ stripes_pattern_alt := *+1

jsr GetWinGoAwayRect
jsr FrameWinRect
jsr SetStripesPattern
jsr SetStripesPattern ; also inits `top` and `bottom`

ldax winrect::x1
sec
Expand All @@ -7605,9 +7609,6 @@ stripes_pattern_alt := *+1
inx
: stax right

copy16 winrect::y1, top
copy16 winrect::y2, bottom

jsr PaintRectImpl ; draws title bar stripes to left of close box

no_goaway:
Expand All @@ -7621,7 +7622,7 @@ no_goaway:
jsr GetWinTitleBarRect
jsr CenterTitleText
jsr PenlocToBounds
jsr SetStripesPattern
jsr SetStripesPattern ; also inits `top` and `bottom`

ldax winrect::x2
clc
Expand Down

0 comments on commit c4392c0

Please sign in to comment.