Fix incorrect subtitle positioning when there are simultaneous
authorCarl Hetherington <cth@carlh.net>
Sun, 3 Feb 2019 22:32:58 +0000 (22:32 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 3 Feb 2019 22:32:58 +0000 (22:32 +0000)
subtitles at the same vposition from different reference points (#1458).

src/lib/render_subtitles.cc

index f4eb625cc9bf84b89e7c3fec72a39f47e0419167..ab4767e1d4bc8cad3809a652246c552f720d4db3 100644 (file)
@@ -366,7 +366,7 @@ render_subtitles (list<SubtitleString> subtitles, list<shared_ptr<Font> > fonts,
        list<PositionImage> images;
 
        BOOST_FOREACH (SubtitleString const & i, subtitles) {
-               if (!pending.empty() && fabs (i.v_position() - pending.back().v_position()) > 1e-4) {
+               if (!pending.empty() && (i.v_align() != pending.back().v_align() || fabs(i.v_position() - pending.back().v_position()) > 1e-4)) {
                        images.push_back (render_line (pending, fonts, target, time, frame_rate));
                        pending.clear ();
                }