From: kramm <kramm>
Date: Sun, 19 Jun 2005 10:57:11 +0000 (+0000)
Subject: fixed a bug in the text bounding box calculation.
X-Git-Tag: release-0-7-0~48
X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=cd3c96f5d5aee5c64e7aaad2360d38e97cdc962f;p=swftools.git

fixed a bug in the text bounding box calculation.
---

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='?';