Closed softworkz closed 9 months ago
I have seen that the margins from the defined styles (neither others) are not having the expected effect. Eventually I was able to trace this down to a WinUI bug for which I have submitted a fix PR now: https://github.com/microsoft/microsoft-ui-xaml/pull/9248
As long as this is not fixed, we need to workaround by switching Before/After and Start/End when using TimedTextPadding as done in this PR.
The current code is ignoring margins from the style definition when only a single margin value is specified in a dialogue line. This is incorrect, as the override needs to done for each value independently (so does AegiSub).
MarginV is a top margin for top-aligned blocks and a bottom margin for bottom-aligned blocks even though the Word doc tells this for style defined margins and otherwise for dialog lines, where it talks about bottom only - which is incorrect (according to AegiSub behavior).
MarginV is unused in case of absolute posiioned elements, but MarginL and MarginR still need to be applied. Unfortunately TimedTextRegions do not allow negative position values, so you already did the best of what is possible for region sizing and positioning. Only the horizontal margins were ignored. Those are now applied in a way that it resembles the behavior of AegiSub (see comments in code).
SubtitleProviderSsaAss: Handle margins when absolute positioning
SubtitleProviderSsaAss: Reverse margins