diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2020-10-15 04:13:10 +0300 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2020-10-15 04:47:20 +0300 |
commit | d60f2dce1dcafaed0e21406213e66072f3036752 (patch) | |
tree | 0f304588a7972f616dd51184b29ef393b59e7274 /libass/ass_render.c | |
parent | a40ec963e5824af0bf834cc740d40dd5ebbccd28 (diff) | |
download | libass-d60f2dce1dcafaed0e21406213e66072f3036752.tar.bz2 libass-d60f2dce1dcafaed0e21406213e66072f3036752.tar.xz |
Scale everything from script resolution if storage size is unknown
With this, our output can no longer change visually if display resolution
is varied via ass_set_frame_size while everything else is kept constant,
e. g. when a video player window is being resized, regardless of API
(mis)use and script/track properties.
In particular, this stops our \blur from affecting a varying portion
of the screen and our 3D transforms involving \frx or \fry from moving
around as display resolution is being changed. FWIW, this makes our
blur and 3D transforms match MPC-HC's when storage size is unset.
They already matched before this commit when ScaledBorderAndShadow
was true, but now they also match when it is false.
This also makes our borders and shadows scale with display resolution,
effectively making ScaledBorderAndShadow a no-op (always true) if storage
size is unset. FWIW, this does *not* agree with MPC-HC, but it just seems
sensibleā¢.
Diffstat (limited to 'libass/ass_render.c')
-rw-r--r-- | libass/ass_render.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c index 62462746..eb3dbaff 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -983,14 +983,12 @@ static void init_font_scale(ASS_Renderer *render_priv) if (settings_priv->storage_height) render_priv->blur_scale = font_scr_h / settings_priv->storage_height; else - render_priv->blur_scale = 1.; + render_priv->blur_scale = font_scr_h / render_priv->track->PlayResY; if (render_priv->track->ScaledBorderAndShadow) render_priv->border_scale = font_scr_h / render_priv->track->PlayResY; else render_priv->border_scale = render_priv->blur_scale; - if (!settings_priv->storage_height) - render_priv->blur_scale = render_priv->border_scale; if (render_priv->state.apply_font_scale) { render_priv->font_scale *= settings_priv->font_size_coeff; |