summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-08-19 23:10:24 +0200
committerGrigori Goronzy <greg@blackbox>2009-08-20 04:41:07 +0200
commitc4e5b08cc0a321da7cd9261bb887a003f0fb2693 (patch)
treedb82392ee158f2517461f88bba14d390ac5df2f8
parentaff07368a515c24f77ac768ffd54be81265df3ff (diff)
downloadlibass-c4e5b08cc0a321da7cd9261bb887a003f0fb2693.tar.bz2
libass-c4e5b08cc0a321da7cd9261bb887a003f0fb2693.tar.xz
VSFilter quirk: double-scale widths of opaque boxes
VSFilter double-scales the widths of the opaque box in X direction, which gives much wider boxes than expected (or much less wider boxes) if ScaleX != 100. Emulate this behavior, even if it is unbelievably stupid and no doubt a bug in VSFilter.
-rw-r--r--libass/ass_render.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 15f568d..0b66e56 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1907,6 +1907,11 @@ static void draw_opaque_box(ASS_Renderer *render_priv, uint32_t ch,
asc *= scale_y;
desc *= scale_y;
+ // Emulate the WTFish behavior of VSFilter, i.e. double-scale
+ // the widths of the opaque box.
+ adv *= render_priv->state.scale_x * render_priv->font_scale_x;
+ sx *= render_priv->state.scale_x * render_priv->font_scale_x;
+
FT_Vector points[4] = {
{ .x = -sx, .y = asc + sy },
{ .x = adv + sx, .y = asc + sy },