Skip to content

Commit

Permalink
Merge pull request #292 from pimoroni/patch-badger2040-text-rotation
Browse files Browse the repository at this point in the history
Badger2040: Fix text rotation aliasing for #290
  • Loading branch information
Gadgetoid committed Mar 11, 2022
2 parents faa8398 + 39e9728 commit 9079a11
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libraries/badger2040/badger2040.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ namespace pimoroni {
int8_t nx = (*pv++) * s;
int8_t ny = (*pv++) * s;

int rcx = cx * ac - cy * as;
int rcy = cx * as + cy * ac;
int rcx = (cx * ac - cy * as) + 0.5f;
int rcy = (cx * as + cy * ac) + 0.5f;

int rnx = nx * ac - ny * as;
int rny = nx * as + ny * ac;
int rnx = (nx * ac - ny * as) + 0.5f;
int rny = (nx * as + ny * ac) + 0.5f;

if(pen_down) {
line(rcx + x, rcy + y, rnx + x, rny + y);
Expand All @@ -293,8 +293,8 @@ namespace pimoroni {
float ac = cos(deg2rad(a));

for(auto &c : message) {
int rcx = ox * ac;
int rcy = ox * as;
int rcx = (ox * ac) + 0.5f;
int rcy = (ox * as) + 0.5f;

ox += glyph(c, cx + rcx, cy + rcy, s, a);
}
Expand Down

0 comments on commit 9079a11

Please sign in to comment.