Merge pull request #292 from pimoroni/patch-badger2040-text-rotation

Badger2040: Fix text rotation aliasing for #290
This commit is contained in:
Philip Howard 2022-03-11 13:54:51 +00:00 committed by GitHub
commit 9079a11d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -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);
@ -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);
}