summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libass/ass_parse.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/libass/ass_parse.c b/libass/ass_parse.c
index aa4a206..3410f83 100644
--- a/libass/ass_parse.c
+++ b/libass/ass_parse.c
@@ -349,26 +349,15 @@ char *parse_tag(ASS_Renderer *render_priv, char *p, double pwr)
render_priv->state.hspacing * (1 - pwr) + val * pwr;
else
render_priv->state.hspacing = render_priv->state.style->Spacing;
- } else if (mystrcmp(&p, "fs+")) {
- double val;
- mystrtod(&p, &val);
- val = render_priv->state.font_size * (1 + pwr * val / 10);
- if (val <= 0)
- val = render_priv->state.style->FontSize;
- if (render_priv->state.font)
- change_font_size(render_priv, val);
- } else if (mystrcmp(&p, "fs-")) {
- double val;
- mystrtod(&p, &val);
- val = render_priv->state.font_size * (1 - pwr * val / 10);
- if (val <= 0)
- val = render_priv->state.style->FontSize;
- if (render_priv->state.font)
- change_font_size(render_priv, val);
} else if (mystrcmp(&p, "fs")) {
double val;
- if (mystrtod(&p, &val))
- val = render_priv->state.font_size * (1 - pwr) + val * pwr;
+ char *start = p;
+ if (mystrtod(&p, &val)) {
+ if (*start == '+' || *start == '-')
+ val = render_priv->state.font_size * (1 + pwr * val / 10);
+ else
+ val = render_priv->state.font_size * (1 - pwr) + val * pwr;
+ }
if (val <= 0)
val = render_priv->state.style->FontSize;
if (render_priv->state.font)