]> granicus.if.org Git - libass/commitdiff
Fix \fs+ and \fs-
authorOleg Oshmyan <chortos@inbox.lv>
Thu, 26 Dec 2013 00:33:57 +0000 (02:33 +0200)
committerOleg Oshmyan <chortos@inbox.lv>
Tue, 7 Jan 2014 20:24:12 +0000 (22:24 +0200)
The argument is a relative amount. The unit is: \fs+1 = +10%.

libass/ass_parse.c

index d2feff3b0aab659963d902545d202647b549ee9b..be22a087c690c209e9e9f9d369517795e3915b79 100644 (file)
@@ -380,7 +380,7 @@ char *parse_tag(ASS_Renderer *render_priv, char *p, double pwr)
     } else if (mystrcmp(&p, "fs+")) {
         double val;
         if (mystrtod(&p, &val)) {
-            val = render_priv->state.font_size + pwr * val;
+            val = render_priv->state.font_size * (1 + pwr * val / 10);
         } else
             val = render_priv->state.style->FontSize;
         if (render_priv->state.font)
@@ -388,7 +388,7 @@ char *parse_tag(ASS_Renderer *render_priv, char *p, double pwr)
     } else if (mystrcmp(&p, "fs-")) {
         double val;
         if (mystrtod(&p, &val))
-            val = render_priv->state.font_size - pwr * val;
+            val = render_priv->state.font_size * (1 - pwr * val / 10);
         else
             val = render_priv->state.style->FontSize;
         if (render_priv->state.font)