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

src/lib/render_text.cc

index d2631e3407808ed7f1c186f0011823fc5b92b317..8d5f8e6a94892170ce28903af6a47b9c3f1862a0 100644 (file)
@@ -350,7 +350,7 @@ render_text (list<StringText> subtitles, list<shared_ptr<Font> > fonts, dcp::Siz
        list<PositionImage> images;
 
        BOOST_FOREACH (StringText 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 ();
                }