Skip to content

Commit 6e7b773

Browse files
committed
Removed unused panel def and fixed draw sprite to clip properly when rotated
1 parent 9acf80b commit 6e7b773

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/FastEPD.inl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ const BBPANELPROCS panelProcs[] = {
239239
{Inkplate5V2EinkPower, Inkplate5V2IOInit, Inkplate5V2RowControl, NULL, Inkplate5V2ExtIO}, // Inkplate5V2
240240
{EPDiyV7EinkPower, EPDiyV7IOInit, EPDiyV7RowControl, EPDiyV7IODeInit, EPDiyV7ExtIO}, // BB_PANEL_EPDIY_V7_16
241241
{EPDiyV7RAWEinkPower, EPDiyV7RAWIOInit, EPDiyV7RowControl, NULL, NULL}, // BB_PANEL_V7_RAW
242-
{EPDiyV7EinkPower, EPDiyV7IOInit, EPDiyV7RowControl, EPDiyV7IODeInit, EPDiyV7ExtIO}, // BB_PANEL_V7_103
243242
{LilyGoEinkPower, LilyGoIOInit, LilyGoRowControl, NULL, NULL},// BB_PANEL_LILYGO_T5PRO
244243
{EPDiyV7EinkPower, EPDiyV7IOInit, EPDiyV7RowControl, EPDiyV7IODeInit, EPDiyV7ExtIO}, // BB_PANEL_LILYGO_T5P4
245244
{EPDiyV7EinkPower, EPDiyV7IOInit, EPDiyV7RowControl, EPDiyV7IODeInit, EPDiyV7ExtIO}, // BB_PANEL_TRMNL_X

src/bb_ep_gfx.inl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ int bbepDrawSprite(FASTEPDSTATE *pSprite, FASTEPDSTATE *pBBEP, int x, int y, int
225225

226226
if (pSprite == NULL || pBBEP == NULL) return BBEP_ERROR_BAD_PARAMETER;
227227

228-
if (x+pSprite->native_width < 0 || y+pSprite->native_height < 0 || x >= pBBEP->native_width || y >= pBBEP->native_height) {
228+
if (x+pSprite->width < 0 || y+pSprite->height < 0 || x >= pBBEP->width || y >= pBBEP->height) {
229229
pBBEP->last_error = BBEP_ERROR_BAD_PARAMETER;
230230
return pBBEP->last_error; // out of bounds
231231
}
@@ -234,17 +234,17 @@ int bbepDrawSprite(FASTEPDSTATE *pSprite, FASTEPDSTATE *pBBEP, int x, int y, int
234234
pBBEP->last_error = BBEP_ERROR_BAD_PARAMETER;
235235
return pBBEP->last_error;
236236
}
237-
cx = pSprite->native_width; // starting size for content to draw
238-
cy = pSprite->native_height;
237+
cx = pSprite->width; // starting size for content to draw
238+
cy = pSprite->height;
239239
dy = y; // destination y
240240
if (y < 0) // skip the invisible parts
241241
{
242242
cy += y;
243243
y = -y;
244244
dy = 0;
245245
}
246-
if ((dy + cy) > pBBEP->native_height) {
247-
cy = pBBEP->native_height - y;
246+
if ((dy + cy) > pBBEP->height) {
247+
cy = pBBEP->height - y;
248248
}
249249
iStartX = 0;
250250
dx = x;
@@ -255,14 +255,14 @@ int bbepDrawSprite(FASTEPDSTATE *pSprite, FASTEPDSTATE *pBBEP, int x, int y, int
255255
iStartX = x;
256256
dx = 0;
257257
}
258-
if ((x + cx) > pBBEP->native_width)
259-
cx = pBBEP->native_width - x;
258+
if ((x + cx) > pBBEP->width)
259+
cx = pBBEP->width - x;
260260
if (pSprite->mode == BB_MODE_1BPP) {
261-
iPitch = (pSprite->native_width + 7)/8;
261+
iPitch = (pSprite->width + 7)/8;
262262
iColor1 = BBEP_WHITE;
263263
iColor0 = BBEP_BLACK;
264264
} else { // 4-bpp
265-
iPitch = (pSprite->native_width + 1)/2;
265+
iPitch = (pSprite->width + 1)/2;
266266
iColor1 = 0xf; // white
267267
iColor0 = 0x0; // black
268268
}

0 commit comments

Comments
 (0)