From cd3c96f5d5aee5c64e7aaad2360d38e97cdc962f Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 19 Jun 2005 10:57:11 +0000 Subject: [PATCH] fixed a bug in the text bounding box calculation. --- src/swfbbox.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/swfbbox.c b/src/swfbbox.c index d0e87cb..b3b8a77 100644 --- a/src/swfbbox.c +++ b/src/swfbbox.c @@ -241,18 +241,22 @@ static void textcallback(void*self, int*chars, int*xpos, int nr, int fontid, int int ch; SRECT newglyphbbox, glyphbbox = font->layout->bounds[chars[t]]; MATRIX m = bounds->m; - + SPOINT p; + if(chars[t] < font->numchars && font->glyph2ascii) { ch = font->glyph2ascii[chars[t]]; } + p.x = x; p.y = y; + p = swf_TurnPoint(p, &m); + m.sx = (m.sx * fontsize) / 1024; m.sy = (m.sy * fontsize) / 1024; m.r0 = (m.r0 * fontsize) / 1024; m.r1 = (m.r1 * fontsize) / 1024; - m.tx += x; - m.ty += y; + m.tx += p.x; + m.ty += p.y; newglyphbbox = swf_TurnRect(glyphbbox, &m); if(ch<32) ch='?'; -- 1.7.10.4