fix: rotate origin in drawImage (#557)

Cherry-picked from upstream PR #557
This commit is contained in:
cottongin
2026-01-27 07:39:27 -05:00
parent 3cee01b43d
commit f01f3979bc
3 changed files with 18 additions and 3 deletions

View File

@@ -183,10 +183,25 @@ void GfxRenderer::fillRectGray(const int x, const int y, const int width, const
}
void GfxRenderer::drawImage(const uint8_t bitmap[], const int x, const int y, const int width, const int height) const {
// TODO: Rotate bits
int rotatedX = 0;
int rotatedY = 0;
rotateCoordinates(x, y, &rotatedX, &rotatedY);
// Rotate origin corner
switch (orientation) {
case Portrait:
rotatedY = rotatedY - height;
break;
case PortraitInverted:
rotatedX = rotatedX - width;
break;
case LandscapeClockwise:
rotatedY = rotatedY - height;
rotatedX = rotatedX - width;
break;
case LandscapeCounterClockwise:
break;
}
// TODO: Rotate bits
einkDisplay.drawImage(bitmap, rotatedX, rotatedY, width, height);
}