Mercurial > MadButterfly
comparison src/shape_text.c @ 289:13ce87b6dbf5
Fix bug of sh_text_t that do not update it-self after changes.
- It is wrong to compute bounding box.
- location of left-top corner is (text->d_x, text->d_y)
not (text->x, text->y).
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sat, 31 Jan 2009 18:28:50 +0800 |
parents | 248a40d51473 |
children | 137a73822d48 |
comparison
equal
deleted
inserted
replaced
288:d5327265da1e | 289:13ce87b6dbf5 |
---|---|
115 shw = shape->stroke_width / 2; | 115 shw = shape->stroke_width / 2; |
116 /* FIXME: It is unreasonable that a font exceed it's bbox. | 116 /* FIXME: It is unreasonable that a font exceed it's bbox. |
117 * We add 5 pixels in get right bbox. But, it is unreasonable. | 117 * We add 5 pixels in get right bbox. But, it is unreasonable. |
118 */ | 118 */ |
119 | 119 |
120 poses[0][0] = x + extents.x - shw; | 120 poses[0][0] = text->d_x + extents.x - shw; |
121 poses[0][1] = y + extents.y - shw; | 121 poses[0][1] = text->d_y + extents.y - shw; |
122 poses[1][0] = poses[0][0] + extents.width + shape->stroke_width; | 122 poses[1][0] = poses[0][0] + extents.width + shape->stroke_width; |
123 poses[1][1] = poses[0][1] + extents.height + shape->stroke_width; | 123 poses[1][1] = poses[0][1] + extents.height + shape->stroke_width; |
124 geo_from_positions(shape->geo, 2, poses); | 124 geo_from_positions(shape->geo, 2, poses); |
125 /*! \todo Support ratation for shape_text. */ | 125 /*! \todo Support ratation for shape_text. */ |
126 } | 126 } |