mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
now building
This commit is contained in:
parent
98f2ba2e80
commit
21f55a697b
@ -173,14 +173,12 @@ NO_INLINE void graphicsDrawChar4x6(JsGraphics *gfx, int x1, int y1, char ch, uns
|
||||
if (idx<0 || idx>=LCD_FONT_4X6_CHARS) {
|
||||
// no char for this
|
||||
if (solidBackground)
|
||||
graphicsFillRect(gfx, x1, y1, x1+2*size, y1+5*size, gfx->data.bgColor);
|
||||
graphicsFillRect(gfx, x1, y1, x1+2*sizex, y1+5*sizey, gfx->data.bgColor);
|
||||
return;
|
||||
}
|
||||
int cidx = idx % 5;
|
||||
idx = (idx/5)*6;
|
||||
int y;
|
||||
int sx = sizex-1;
|
||||
int sy = sizey-1;
|
||||
for (y=0;y<6;y++) {
|
||||
int line = READ_FLASH_UINT16(&LCD_FONT_4X6[idx + y]) >> (cidx*3);
|
||||
int ly = y*sizey + y1;
|
||||
@ -190,12 +188,17 @@ NO_INLINE void graphicsDrawChar4x6(JsGraphics *gfx, int x1, int y1, char ch, uns
|
||||
graphicsFillRect(
|
||||
gfx,
|
||||
x1+x*sizex, ly,
|
||||
x1+s+x*sizex, ly+sy,
|
||||
x1+x*(sizex+1) - 1, ly+sizey-1,
|
||||
pixel ? gfx->data.fgColor : gfx->data.bgColor);
|
||||
line <<= 1;
|
||||
}
|
||||
}
|
||||
if (solidBackground) graphicsFillRect(gfx, x1+3*sizex, y1, x1+sx+3*sizex, y1+sizey*5+sy, gfx->data.bgColor); // fill gap between chars
|
||||
if (solidBackground)
|
||||
graphicsFillRect(
|
||||
gfx,
|
||||
x1+3*sizex, y1,
|
||||
x1+4*sizex-1, y1+sizey*6-1,
|
||||
gfx->data.bgColor); // fill gap between chars
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -415,7 +415,7 @@ NO_INLINE void graphicsDrawChar6x8(JsGraphics *gfx, int x1, int y1, char ch, uns
|
||||
idx = (idx/6)*8;
|
||||
int y;
|
||||
int sx = sizex-1;
|
||||
int sx = sizey-1;
|
||||
int sy = sizey-1;
|
||||
for (y=0;y<8;y++) {
|
||||
unsigned int line = LCD_FONT_6X8[idx + y] >> (cidx*5);
|
||||
int ly = y*sizey + y1;
|
||||
@ -425,12 +425,12 @@ NO_INLINE void graphicsDrawChar6x8(JsGraphics *gfx, int x1, int y1, char ch, uns
|
||||
graphicsFillRect(
|
||||
gfx,
|
||||
x1+x*sizex, ly,
|
||||
x1+s+x*sizex, ly+sy,
|
||||
x1+sx+x*sizex, ly+sy,
|
||||
pixel ? gfx->data.fgColor : gfx->data.bgColor);
|
||||
line <<= 1;
|
||||
}
|
||||
}
|
||||
if (solidBackground) graphicsFillRect(gfx, x1+5*sizex, y1, x1+s+5*sizex, y1+sizey*7+sy, gfx->data.bgColor); // fill gap between chars
|
||||
if (solidBackground) graphicsFillRect(gfx, x1+5*sizex, y1, x1+sx+5*sizex, y1+sizey*7+sy, gfx->data.bgColor); // fill gap between chars
|
||||
}
|
||||
|
||||
#endif // USE_FONT_6X8
|
||||
|
||||
@ -808,7 +808,7 @@ void graphicsScroll(JsGraphics *gfx, int xdir, int ydir) {
|
||||
static void graphicsDrawString(JsGraphics *gfx, int x1, int y1, const char *str) {
|
||||
// no need to modify coordinates as setPixel does that
|
||||
while (*str) {
|
||||
graphicsDrawChar4x6(gfx,x1,y1,*(str++),1,false);
|
||||
graphicsDrawChar4x6(gfx,x1,y1,*(str++),1,1,false);
|
||||
x1 = (int)(x1 + 4);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user