From d4bd51a0b1e7192773af328213b51b19931602db Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Mon, 30 Jan 2017 23:45:43 +0200 Subject: Reflect border_scale in outline cache keys border_scale can change, e. g. when ass_render_frame is called twice with the same renderer but different tracks. Glyphs with equal \bord tag values but different border_scale values produce different border outlines and hence should be distinguished in outline cache keys. To this end, store scaled border widths (which are really used when generating the outlines) in cache keys instead of \bord tag values. --- libass/ass_render.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index 4e97d2a..558f504 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1084,8 +1084,8 @@ fill_glyph_hash(ASS_Renderer *priv, OutlineHashKey *outline_key, outline_key->type = OUTLINE_DRAWING; key->scale_x = double_to_d16(info->scale_x); key->scale_y = double_to_d16(info->scale_y); - key->outline.x = double_to_d16(info->border_x); - key->outline.y = double_to_d16(info->border_y); + key->outline.x = double_to_d16(info->border_x * priv->border_scale); + key->outline.y = double_to_d16(info->border_y * priv->border_scale); key->border_style = info->border_style; // hpacing only matters for opaque box borders (see draw_opaque_box), // so for normal borders, maximize cache utility by ignoring it @@ -1106,8 +1106,8 @@ fill_glyph_hash(ASS_Renderer *priv, OutlineHashKey *outline_key, key->italic = info->italic; key->scale_x = double_to_d16(info->scale_x); key->scale_y = double_to_d16(info->scale_y); - key->outline.x = double_to_d16(info->border_x); - key->outline.y = double_to_d16(info->border_y); + key->outline.x = double_to_d16(info->border_x * priv->border_scale); + key->outline.y = double_to_d16(info->border_y * priv->border_scale); key->flags = info->flags; key->border_style = info->border_style; key->hspacing = -- cgit v1.2.3