From 9053a8274c32c57041a1f8a7fdb0206abbbd4f50 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 10 Jun 2016 14:41:51 +0100 Subject: Go back to referencing subrip from the top of the frame. --- src/lib/subtitle_decoder.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/subtitle_decoder.cc b/src/lib/subtitle_decoder.cc index d210c578f..f8f179587 100644 --- a/src/lib/subtitle_decoder.cc +++ b/src/lib/subtitle_decoder.cc @@ -141,9 +141,14 @@ SubtitleDecoder::give_text (ContentTimePeriod period, sub::Subtitle const & subt { /* See if our next subtitle needs to be placed on screen by us */ bool needs_placement = false; + optional bottom_line; BOOST_FOREACH (sub::Line i, subtitle.lines) { if (!i.vertical_position.reference || i.vertical_position.reference.get() == sub::TOP_OF_SUBTITLE) { needs_placement = true; + DCPOMATIC_ASSERT (i.vertical_position.line); + if (!bottom_line || bottom_line.get() < i.vertical_position.line.get()) { + bottom_line = i.vertical_position.line.get(); + } } } @@ -163,8 +168,8 @@ SubtitleDecoder::give_text (ContentTimePeriod period, sub::Subtitle const & subt /* This 0.053 is an arbitrary value to lift the bottom sub off the bottom of the screen a bit to a pleasing degree. */ - v_position = 0.053 + i.vertical_position.line.get() * 1.2 * j.font_size.proportional (72 * 11); - v_align = dcp::VALIGN_BOTTOM; + v_position = 1.015 - (1 + bottom_line.get() - i.vertical_position.line.get()) * 1.2 * j.font_size.proportional (72 * 11); + v_align = dcp::VALIGN_TOP; } else { DCPOMATIC_ASSERT (i.vertical_position.proportional); DCPOMATIC_ASSERT (i.vertical_position.reference); -- cgit v1.2.3