diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2020-07-07 02:37:03 +0300 |
---|---|---|
committer | Oneric <oneric@oneric.stub> | 2022-09-24 20:24:47 +0200 |
commit | f08f8ea522d20dd9985544c636e45e4984a0d743 (patch) | |
tree | e56b7ec32fc1d46e95824062b1f50d3f8b8e0d22 /libass/ass_render.h | |
parent | b6db99a3930b609ca1ba5a0b9930b5c6dc5701dc (diff) | |
download | libass-f08f8ea522d20dd9985544c636e45e4984a0d743.tar.bz2 libass-f08f8ea522d20dd9985544c636e45e4984a0d743.tar.xz |
Fix scaling in x direction
VSFilter scales several features based on width/PlayResX
but libass until now didn't. This affects:
- explicit vector drawing coordinates
- font spacing
- borders
- shadows
This list was obtained by checking against Cyberbeing/xy-VSFilter
code and searching forevery occurence of m_scalex.
This m_scalex factor is also used for the Banner effect,
to make the delay PlayRes-relative, but in libass the value
is PlayRes-relative by default without needing to be scaled.
Additionally, libass neglected to compensate anamorphic stretching
for some features which is also being fixed now.
Both omissions combined actually happened to cancel each other out
for some PlayRes-relative feature in specific but not unusual cases.
If subs for an anamorphic video use isotropically scaled storage
resolution as PlayRes, libass already rendered e.g. vector drawings
correctly. However, other features like e.g. \xshad used to only render
correctly if isotropically scaled display res was used. Thus, more
complex typesetting actually was never rendered correctly on anamorphic
video before this change.
Fixes https://github.com/libass/libass/issues/171.
Diffstat (limited to 'libass/ass_render.h')
-rw-r--r-- | libass/ass_render.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libass/ass_render.h b/libass/ass_render.h index af1516c..9034b35 100644 --- a/libass/ass_render.h +++ b/libass/ass_render.h @@ -315,9 +315,11 @@ struct ass_renderer { double fit_width; // frame width without zoom & pan (fit to screen & letterboxed) ASS_Track *track; long long time; // frame's timestamp, ms - double font_scale; + double screen_scale_x; + double screen_scale_y; double font_scale_x; // x scale applied to all glyphs to preserve text aspect ratio - double border_scale; + double border_scale_x; + double border_scale_y; double blur_scale; RenderContext state; |