diff options
-rw-r--r-- | libass/ass_bitmap.c | 7 | ||||
-rw-r--r-- | libass/ass_bitmap.h | 3 | ||||
-rw-r--r-- | libass/ass_render.c | 6 |
3 files changed, 10 insertions, 6 deletions
diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index e5738e2..0ad1647 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -456,7 +456,7 @@ int outline_to_bitmap3(ASS_Library *library, ASS_SynthPriv *priv_blur, FT_Library ftlib, FT_Outline *outline, FT_Outline *border, Bitmap **bm_g, Bitmap **bm_o, Bitmap **bm_s, int be, double blur_radius, FT_Vector shadow_offset, - int border_style) + int border_style, int border_visible) { blur_radius *= 2; int bbord = be > 0 ? sqrt(2 * be) : 0; @@ -512,8 +512,11 @@ int outline_to_bitmap3(ASS_Library *library, ASS_SynthPriv *priv_blur, if (*bm_o && border_style != 3) { *bm_s = copy_bitmap(*bm_o); fix_outline(*bm_g, *bm_o); - } else if (*bm_o) { + } else if (*bm_o && border_visible) { *bm_s = copy_bitmap(*bm_o); + } else if (*bm_o) { + *bm_s = *bm_o; + *bm_o = 0; } else *bm_s = copy_bitmap(*bm_g); diff --git a/libass/ass_bitmap.h b/libass/ass_bitmap.h index 2a46aec..53be7af 100644 --- a/libass/ass_bitmap.h +++ b/libass/ass_bitmap.h @@ -46,12 +46,13 @@ Bitmap *outline_to_bitmap(ASS_Library *library, FT_Library ftlib, * \param bm_o out: pointer to the bitmap of outline (border) glyph is returned here * \param bm_g out: pointer to the bitmap of glyph shadow is returned here * \param be 1 = produces blurred bitmaps, 0 = normal bitmaps + * \param border_visible whether border is visible if border_style is 3 */ int outline_to_bitmap3(ASS_Library *library, ASS_SynthPriv *priv_blur, FT_Library ftlib, FT_Outline *outline, FT_Outline *border, Bitmap **bm_g, Bitmap **bm_o, Bitmap **bm_s, int be, double blur_radius, FT_Vector shadow_offset, - int border_style); + int border_style, int border_visible); void ass_free_bitmap(Bitmap *bm); diff --git a/libass/ass_render.c b/libass/ass_render.c index a596ec4..a0971f2 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1125,8 +1125,7 @@ get_outline_glyph(ASS_Renderer *priv, GlyphInfo *info) FT_Outline_Get_CBox(v.outline, &v.bbox_scaled); - if (info->border_style == 3 && - (info->border_x > 0 || info->border_y > 0)) { + if (info->border_style == 3) { FT_Vector advance; v.border = calloc(1, sizeof(FT_Outline)); @@ -1311,7 +1310,8 @@ get_bitmap_glyph(ASS_Renderer *render_priv, GlyphInfo *info) &hash_val.bm_s, info->be, info->blur * render_priv->border_scale, key->shadow_offset, - info->border_style); + info->border_style, + info->border_x || info->border_y); if (error) info->symbol = 0; |