summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2012-12-16 23:54:57 +0200
committerOleg Oshmyan <chortos@inbox.lv>2012-12-28 19:01:16 +0200
commit071e23b7f41382fc07d657699574b24827fa240d (patch)
tree81a1546f586df17ffda0732eb92c364a048007a0
parentfb1109b4bdec040dab5cdb00a342557b977e9c12 (diff)
downloadlibass-071e23b7f41382fc07d657699574b24827fa240d.tar.bz2
libass-071e23b7f41382fc07d657699574b24827fa240d.tar.xz
Use glyph properties instead of renderer state in draw_opaque_box
scale_x, scale_y and hspacing should be read from the GlyphInfo of the glyph the box is based on, not from render_priv->state. The values in the renderer state are affected by override tags specified after this glyph, so they are irrelevant.
-rw-r--r--libass/ass_render.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index a0971f2..6318656 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -925,13 +925,14 @@ static void free_render_context(ASS_Renderer *render_priv)
* Replace the outline of a glyph by a contour which makes up a simple
* opaque rectangle.
*/
-static void draw_opaque_box(ASS_Renderer *render_priv, int asc, int desc,
- FT_Outline *ol, FT_Vector advance, int sx, int sy)
+static void draw_opaque_box(ASS_Renderer *render_priv, GlyphInfo *info,
+ int asc, int desc, FT_Outline *ol,
+ FT_Vector advance, int sx, int sy)
{
int i;
int adv = advance.x;
- double scale_y = render_priv->state.scale_y;
- double scale_x = render_priv->state.scale_x;
+ double scale_y = info->scale_y;
+ double scale_x = info->scale_x;
// to avoid gaps
sx = FFMAX(64, sx);
@@ -939,8 +940,7 @@ static void draw_opaque_box(ASS_Renderer *render_priv, int asc, int desc,
// Emulate the WTFish behavior of VSFilter, i.e. double-scale
// the sizes of the opaque box.
- adv += double_to_d6(render_priv->state.hspacing * render_priv->font_scale
- * scale_x);
+ adv += double_to_d6(info->hspacing * render_priv->font_scale * scale_x);
adv *= scale_x;
sx *= scale_x;
sy *= scale_y;
@@ -1135,7 +1135,7 @@ get_outline_glyph(ASS_Renderer *priv, GlyphInfo *info)
else
advance = info->advance;
- draw_opaque_box(priv, v.asc, v.desc, v.border, advance,
+ draw_opaque_box(priv, info, v.asc, v.desc, v.border, advance,
double_to_d6(info->border_x * priv->border_scale),
double_to_d6(info->border_y * priv->border_scale));