Take y scale into account when deciding subtitle line spacing.
authorCarl Hetherington <cth@carlh.net>
Sat, 2 Jul 2016 22:52:54 +0000 (23:52 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 2 Jul 2016 22:52:54 +0000 (23:52 +0100)
src/lib/player.cc
src/lib/subtitle_decoder.cc

index e24baf3fa0ae67eea1099bb8a58abe66fb8898af..f8bfb527beb48b63c1494c194c6877053cd3a817 100644 (file)
@@ -181,7 +181,8 @@ Player::playlist_content_changed (weak_ptr<Content> w, int property, bool freque
                Changed (frequent);
 
        } else if (
-               property == SubtitleContentProperty::LINE_SPACING
+               property == SubtitleContentProperty::LINE_SPACING ||
+               property == SubtitleContentProperty::Y_SCALE
                ) {
 
                /* These changes just need the pieces' decoders to be reset.
@@ -199,7 +200,6 @@ Player::playlist_content_changed (weak_ptr<Content> w, int property, bool freque
                property == SubtitleContentProperty::X_OFFSET ||
                property == SubtitleContentProperty::Y_OFFSET ||
                property == SubtitleContentProperty::X_SCALE ||
-               property == SubtitleContentProperty::Y_SCALE ||
                property == SubtitleContentProperty::FONTS ||
                property == VideoContentProperty::CROP ||
                property == VideoContentProperty::SCALE ||
index 63ab7c471a634a421c03930317fe1e991ab55b8b..72c6883fb548f7afb3fe85b9d6956cd7cfc5dc13 100644 (file)
@@ -174,8 +174,9 @@ SubtitleDecoder::give_text (ContentTimePeriod period, sub::Subtitle const & subt
                                /* This 1.015 is an arbitrary value to lift the bottom sub off the bottom
                                   of the screen a bit to a pleasing degree.
                                */
-                               v_position = 1.015 - (1 + bottom_line.get() - i.vertical_position.line.get())
-                                       * 1.2 * content()->line_spacing() * j.font_size.proportional (72 * 11);
+                               v_position = 1.015 -
+                                       (1 + bottom_line.get() - i.vertical_position.line.get())
+                                       * 1.2 * content()->line_spacing() * content()->y_scale() * j.font_size.proportional (72 * 11);
 
                                v_align = dcp::VALIGN_TOP;
                        } else {