Mercurial > MadButterfly
changeset 446:2437047b8bb8
Fix bug of propertional shifting of sh_stext_t.
Original
- sh_stext_t does not apply shifting of text himself to scaled font face, but
- apply aggreagated matrix to font face.
- shifting in parent parent coord_t would applied to scaled font.
- amount of shifting is also multiplied by aggreagated matrix.
- It means shiftings of parent coord_ts are applied two times.
Now,
- remove x, y shifting from aggreagated matrices before applying
to scaled fonts.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sun, 02 Aug 2009 10:59:59 +0800 |
parents | cb1a65d53878 |
children | 38aae921243f |
files | src/shape_stext.c |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/shape_stext.c Sat Aug 01 20:56:31 2009 +0800 +++ b/src/shape_stext.c Sun Aug 02 10:59:59 2009 +0800 @@ -454,16 +454,21 @@ co_aix font_sz) { co_aix matrix[6], scaled_matrix[6]; co_aix *aggr; + co_aix noshift_aggr[6]; mb_scaled_font_t *scaled; aggr = sh_get_aggr_matrix((shape_t *)txt_o); + memcpy(noshift_aggr, aggr, sizeof(co_aix) * 6); + noshift_aggr[2] = 0; + noshift_aggr[5] = 0; + matrix[0] = font_sz; matrix[1] = 0; matrix[2] = shift_x; matrix[3] = 0; matrix[4] = font_sz; matrix[5] += shift_y; - matrix_mul(aggr, matrix, scaled_matrix); + matrix_mul(noshift_aggr, matrix, scaled_matrix); scaled = make_scaled_font_face_matrix(face, scaled_matrix);