diff options
author | Stefano Gottardo <gottardo.stefano.83@gmail.com> | 2023-02-12 14:01:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-12 14:01:02 +0100 |
commit | 8fe89bac2422b829284f7bbdd3b92c92d63b854d (patch) | |
tree | 5ace33d076b204aa2cc2bf32f6ee3a2322b75e61 | |
parent | cd24ce4af78875fedd0e751a69b2c9c879a8edb6 (diff) | |
parent | bfb18b67418a95016daf698c2f4de1cb861c9c2b (diff) |
Merge pull request #22651 from CastagnaIT/libass_linespace
[Subtitles][Libass] Fix line spacing to avoid overlap box
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp | 6 |
1 files 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<struct style>& 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<struct style>& 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<double>(opts.frameHeight)); style->Blur = (10.00 / 100 * subStyle->blur); |