Merge pull request #292 from pimoroni/patch-badger2040-text-rotation
Badger2040: Fix text rotation aliasing for #290
This commit is contained in:
commit
9079a11d41
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue