From 0a87a84e67961b169923912528bee52c1fc8578d Mon Sep 17 00:00:00 2001 From: root <182859762@qq.com> Date: Sat, 3 Sep 2022 13:10:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=9A=E4=B8=8A=E4=B8=AA?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=BC=9A=E8=AE=BF=E9=97=AE=E9=9D=9E=E6=B3=95?= =?UTF-8?q?=E5=86=85=E5=AD=98=E5=AF=BC=E8=87=B4=E6=AE=B5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/arm11/acf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/arm11/acf.c b/source/arm11/acf.c index bd4a817..6730165 100644 --- a/source/arm11/acf.c +++ b/source/arm11/acf.c @@ -299,11 +299,12 @@ static int render_unicode(FHandle fd, int *x, unsigned width, unsigned height, u { for (int j = 0; j < bbx[0]; ++j) { - if( 0 <= i && i < (int)height && 0 <= j && j < (int)width ) + int tx = cx+j, ty = cy-i; + if( 0 <= ty && ty < (int)height && 0 <= tx && tx < (int)width ) { if( BIT_AT_POS(glyph, bbx[0] * i + j) ) { - SET_AT_POS( ram, PIX_IN_LINE(cx+j, cy-i, width) ); + SET_AT_POS( ram, PIX_IN_LINE(tx, ty, width) ); } } } @@ -341,7 +342,7 @@ const char *acf_draw(int x, int y, unsigned width, unsigned height, unsigned max next != NULL; next = next_unicode(utf8_line, &unicode)) { - int error = render_unicode(font, &linex, maxwidth, height, unicode, option, localram); + int error = render_unicode(font, &linex, maxwidth, gblfont.height, unicode, option, localram); if (error > 0 ) break; else if(error < 0 ) error = render_unicode(font, &linex, maxwidth, height, '?', option, localram);