修正use_canvas的bug

This commit is contained in:
anod 2022-10-05 09:57:28 +08:00
parent cb79ee343e
commit 5657569af0

View File

@ -356,7 +356,6 @@ acf_canvas_t acf_get_canvas(acf_rectedge_t width, acf_text_t text, acf_rectedge_
acf_rectedge_t *canvas = malloc( ACFONT_CANVAS_MEMSIZE(width, gblfont.height) );
memset(canvas, 0, ACFONT_CANVAS_MEMSIZE(width, gblfont.height));
*canvas = width;
for (const char *next = next_unicode(utf8_line, &unicode);
next != NULL;
@ -381,6 +380,9 @@ acf_canvas_t acf_get_canvas(acf_rectedge_t width, acf_text_t text, acf_rectedge_
if( renderedcnt != NULL ) *renderedcnt = rendered_count;
if( rest != NULL ) *rest = utf8_line;
*canvas = width;
*(canvas+1) = linex;
fClose(font);
return canvas;
}