From fb1109b4bdec040dab5cdb00a342557b977e9c12 Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Sun, 16 Dec 2012 19:02:32 +0200 Subject: Properly render opaque box shadows even when there is no border Even if the border size is zero, the shadow is supposed to be a copy of a hypothetical border: when border_style is 1, this coincides with the borderless glyph, but when border_style is 3, the shadow must be an opaque box. Opaque box borders are now generated regardless of border size being non-zero, and outline_to_bitmap3 gets a new flag indicating whether it should discard the border (after generating a shadow from it). --- libass/ass_bitmap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libass/ass_bitmap.c') diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index e5738e24..0ad16474 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); -- cgit v1.2.3