mirror of
git://projects.qi-hardware.com/antorcha.git
synced 2024-11-25 19:29:23 +02:00
tools/libtxt/font.c (do_draw): we can now have negative coordinates; clip them too
This commit is contained in:
parent
5e94179a29
commit
3faf58c601
@ -256,10 +256,10 @@ static void do_draw(uint8_t *canvas, int width, int heigth,
|
|||||||
int ix, iy, xt;
|
int ix, iy, xt;
|
||||||
|
|
||||||
for (ix = 0; ix != w; ix++) {
|
for (ix = 0; ix != w; ix++) {
|
||||||
if (x+ix >= width)
|
if (x+ix < 0 || x+ix >= width)
|
||||||
continue;
|
continue;
|
||||||
for (iy = 0; iy != h; iy++) {
|
for (iy = 0; iy != h; iy++) {
|
||||||
if (y+iy >= heigth)
|
if (y+iy < 0 || y+iy >= heigth)
|
||||||
continue;
|
continue;
|
||||||
xt = ox+ix;
|
xt = ox+ix;
|
||||||
if (img->data[(oy+iy)*img->span+(xt >> 3)] &
|
if (img->data[(oy+iy)*img->span+(xt >> 3)] &
|
||||||
|
Loading…
Reference in New Issue
Block a user