Add similar rounding to subtitle offsets as already exist for scale,
authorCarl Hetherington <cth@carlh.net>
Mon, 11 Apr 2016 22:05:22 +0000 (23:05 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 11 Apr 2016 22:05:22 +0000 (23:05 +0100)
to try to fix strange sticking of spin buttons on arbitrary values.

ChangeLog
src/wx/subtitle_panel.cc

index a5c68e7764b5b7777c7d3c47f9228b189b9e3b54..171f9d8215f290ca910a2f15308220af37f8a951 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2016-04-11  Carl Hetherington  <cth@carlh.net>
 
+       * Hopefully fix strange limits on x/y offset of subtitles.
+
        * Add UTC-3:30 timezone to Cinema configuration (#831).
 
        * Add option to preview left or right eye (#809).
index ad6a024e6682ed2193597641deedf4a4711ccba2..a53679673f649e90dd88d40517b260b223da5dd6 100644 (file)
@@ -190,9 +190,9 @@ SubtitlePanel::film_content_changed (int property)
        } else if (property == SubtitleContentProperty::BURN_SUBTITLES) {
                checked_set (_burn, scs ? scs->burn_subtitles() : false);
        } else if (property == SubtitleContentProperty::SUBTITLE_X_OFFSET) {
-               checked_set (_x_offset, scs ? (scs->subtitle_x_offset() * 100) : 0);
+               checked_set (_x_offset, scs ? lrint (scs->subtitle_x_offset() * 100) : 0);
        } else if (property == SubtitleContentProperty::SUBTITLE_Y_OFFSET) {
-               checked_set (_y_offset, scs ? (scs->subtitle_y_offset() * 100) : 0);
+               checked_set (_y_offset, scs ? lrint (scs->subtitle_y_offset() * 100) : 0);
        } else if (property == SubtitleContentProperty::SUBTITLE_X_SCALE) {
                checked_set (_x_scale, scs ? lrint (scs->subtitle_x_scale() * 100) : 100);
        } else if (property == SubtitleContentProperty::SUBTITLE_Y_SCALE) {