summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-06-29 05:19:40 +0200
committerGrigori Goronzy <greg@blackbox>2009-06-29 05:23:49 +0200
commit00983363e4356fd4bd0da3659f37707b31fc6597 (patch)
treef9d8a06c2d925d6f8151c9ca1f2cdaa026483adb
parent1f176b7645318ec5d3f0e2dee81986b14eb8f1c2 (diff)
downloadlibass-00983363e4356fd4bd0da3659f37707b31fc6597.tar.bz2
libass-00983363e4356fd4bd0da3659f37707b31fc6597.tar.xz
Fix two-pass stroking for \xbord, \ybord
The two-pass stroker blindly assumed that the number of points of the stroked glyph is the same, no matter the size of the stroker. Unfortunately, this is not the case every time. In such cases, the coordinates will only be replaced up to mininum of points of both glyphs. It's incredibly hacky, but seems to work well (and look good).
-rw-r--r--libass/ass_render.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 86dfd3d..d3d53e4 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1799,7 +1799,7 @@ get_outline_glyph(ass_renderer_t *render_priv, int symbol,
// 2nd pass if x/y borders are different
if (render_priv->state.border_x != render_priv->state.border_y) {
- int i;
+ int i, m;
FT_Glyph g;
FT_OutlineGlyph go, gi;
@@ -1814,7 +1814,8 @@ get_outline_glyph(ass_renderer_t *render_priv, int symbol,
// Replace x coordinates
go = (FT_OutlineGlyph) info->outline_glyph;
gi = (FT_OutlineGlyph) g;
- for (i = 0; i < go->outline.n_points; i++)
+ m = FFMIN(go->outline.n_points, gi->outline.n_points);
+ for (i = 0; i < m; i++)
go->outline.points[i].x = gi->outline.points[i].x;
FT_Done_Glyph(g);
}