Subtitle v position is from 0->1, not a %age.
authorCarl Hetherington <cth@carlh.net>
Wed, 1 Oct 2014 23:13:17 +0000 (00:13 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 1 Oct 2014 23:13:17 +0000 (00:13 +0100)
src/lib/render_subtitles.cc

index 5364b8dfe3eeb9a3e0f0c1655c2b1ff4a425ca3a..6f103246c9c6f3538de616f153062308fe6b0de9 100644 (file)
@@ -37,11 +37,11 @@ calculate_position (dcp::VAlign v_align, double v_position, int target_height, i
 {
        switch (v_align) {
        case dcp::TOP:
-               return (v_position / 100) * target_height - offset;
+               return v_position * target_height - offset;
        case dcp::CENTER:
-               return (0.5 + v_position / 100) * target_height - offset;
+               return (0.5 + v_position) * target_height - offset;
        case dcp::BOTTOM:
-               return (1.0 - v_position / 100) * target_height - offset;
+               return (1.0 - v_position) * target_height - offset;
        }
 
        return 0;