]> granicus.if.org Git - libass/commitdiff
VSFilter quirk: double-scale widths of opaque boxes
authorGrigori Goronzy <greg@blackbox>
Wed, 19 Aug 2009 21:10:24 +0000 (23:10 +0200)
committerGrigori Goronzy <greg@blackbox>
Thu, 20 Aug 2009 02:41:07 +0000 (04:41 +0200)
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.

libass/ass_render.c

index 15f568d92d5feb840008505de28de525147b94f3..0b66e5696c7a5874525e55ff09b69874fb59226e 100644 (file)
@@ -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 },