summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-12-09 09:42:30 -0500
committerDavid Thompson <dthompson2@worcester.edu>2021-12-09 09:42:30 -0500
commit688918dd3a70182ca71469110978cdaea8ae3d09 (patch)
treed550b3d96cfbdf6bfdd6dfa1e9cf19401fb1b5d5
parentff051cf01fe0aa7f84f6655140b7823e80af79ce (diff)
graphics: font: Fix Y-coordinates of bitmap font characters.
Fixes a regression introduced in the last release. Oopsies.
-rw-r--r--chickadee/graphics/font.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/chickadee/graphics/font.scm b/chickadee/graphics/font.scm
index a3ed823..c818ff8 100644
--- a/chickadee/graphics/font.scm
+++ b/chickadee/graphics/font.scm
@@ -385,7 +385,10 @@ extension must be either .xml or .fnt."
(width (attr node 'width string->number))
(height (attr node 'height string->number))
(x (attr node 'x string->number))
- (y (attr node 'y string->number))
+ ;; Invert the y axis. Our origin is the
+ ;; bottom-left corner, not top-left.
+ (y (- image-height height
+ (attr node 'y string->number)))
(x-offset (attr node 'xoffset string->number))
(y-offset (- line-height height
(attr node 'yoffset string->number)))