aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Hochecker <fernetmenta@online.de>2015-06-13 15:30:32 +0200
committerRainer Hochecker <fernetmenta@online.de>2015-06-13 16:50:32 +0200
commit54137be7060a1f791582244ae2ae3d5799fc1271 (patch)
treeb718524095de7ab6f07559087e134c8cbbb8d210
parentb5ae02df4b1db9e394c1e9f31bcb6dd10c333a18 (diff)
renderer: fix overlapping subtitles for alignments other than fixed
-rw-r--r--xbmc/cores/VideoRenderers/OverlayRenderer.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp
index 5a9f2e8025..08ffdc659b 100644
--- a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp
+++ b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp
@@ -188,12 +188,13 @@ void CRenderer::Render(int idx)
}
float total_height = 0.0f;
+ float cur_height = 0.0f;
+ int subalign = CSettings::Get().GetInt("subtitles.align");
for (std::vector<COverlay*>::iterator it = render.begin(); it != render.end(); ++it)
{
COverlay* o = *it;
o->PrepareRender();
- if (o->m_align == COverlay::ALIGN_SUBTITLE)
- total_height += o->m_height;
+ total_height += o->m_height;
}
for (std::vector<COverlay*>::iterator it = render.begin(); it != render.end(); ++it)
@@ -201,7 +202,14 @@ void CRenderer::Render(int idx)
COverlay* o = *it;
float adjust_height = 0.0f;
- if (o->m_align == COverlay::ALIGN_SUBTITLE)
+
+ if(subalign == SUBTITLE_ALIGN_TOP_INSIDE ||
+ subalign == SUBTITLE_ALIGN_TOP_OUTSIDE)
+ {
+ adjust_height = cur_height;
+ cur_height += o->m_height;
+ }
+ else
{
total_height -= o->m_height;
adjust_height = -total_height;