From bfb18b67418a95016daf698c2f4de1cb861c9c2b Mon Sep 17 00:00:00 2001 From: CastagnaIT Date: Tue, 31 Jan 2023 17:25:26 +0100 Subject: [Subtitles][Libass] Fix line spacing to avoid overlap box --- xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp b/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp index 8a5f80b09a..8ac6a3fee6 100644 --- a/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp +++ b/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp @@ -456,7 +456,7 @@ void CDVDSubtitlesLibass::ApplyStyle(const std::shared_ptr& subSty ConvColor(subStyle->shadowColor, subStyle->shadowOpacity); // Set the box shadow color style->Shadow = (10.00 / 100 * subStyle->shadowSize) * scale; // Set the box shadow size // By default a box overlaps the other, then we increase a bit the line spacing - lineSpacing = 6.0; + lineSpacing = 8.0 * scaleDefault; } else if (subStyle->borderStyle == BorderType::SQUARE_BOX) { @@ -468,7 +468,9 @@ void CDVDSubtitlesLibass::ApplyStyle(const std::shared_ptr& subSty style->Shadow = 4 * scale; // Space between the text and the box edges } - ass_set_line_spacing(m_renderer, lineSpacing); + // ass_set_line_spacing do not scale, so we have to scale to frame size + ass_set_line_spacing(m_renderer, + lineSpacing / playResY * static_cast(opts.frameHeight)); style->Blur = (10.00 / 100 * subStyle->blur); -- cgit v1.2.3