diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2021-06-04 09:46:25 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2021-06-04 09:46:25 (GMT) |
| commit | 4ad827390227249ba69f1ae60671b20531fdd9e1 (patch) | |
| tree | 519deed3bf06233335b55f3e0185e9d1df164b38 /wasp/boards/simulator | |
| parent | 1115ac2fff0057df93ea8a6ccdb93102cec0c465 (diff) | |
draw565: Fix bounding box calculations
wasp-os uses an drawing optimization technique to automatically place
a single pixel line on the right of glyphs when rendering them. This
results in a change to the bounding box for a rendered string (by adding
a single pixel on the right of the final character). Fix the bounding box
calculations accordingly. Among other things this eliminates graphical
artifacts when rendering labels in 2048.
Fixes: #203
Fixes: 58b5c0378ec3 ("draw565: Optimize the string drawing")
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/boards/simulator')
| -rw-r--r-- | wasp/boards/simulator/test_unit.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wasp/boards/simulator/test_unit.py b/wasp/boards/simulator/test_unit.py index 940edba..f292c9a 100644 --- a/wasp/boards/simulator/test_unit.py +++ b/wasp/boards/simulator/test_unit.py @@ -53,7 +53,7 @@ def test_font_width(draw): for f in (fonts.sans24, fonts.sans28, fonts.sans36): draw.set_font(f) - assert 3 == draw.bounding_box('0000')[0] % 4 + assert 0 == draw.bounding_box('0000')[0] % 4 if f.max_ch() >= 90: assert draw.bounding_box('IIII')[0] < draw.bounding_box('WWWW')[0] |
