Stop subtitles wandering about when re-setup.
authorCarl Hetherington <cth@carlh.net>
Thu, 11 Oct 2012 12:54:14 +0000 (13:54 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 11 Oct 2012 12:54:14 +0000 (13:54 +0100)
src/wx/film_viewer.cc

index 6a992f0db9e305c7ab11840636f875c42509afc8..cd043b04e6d9ff1d355cb59e9e6d15535a861f24 100644 (file)
@@ -74,7 +74,7 @@ public:
 
                if (_film->with_subtitles ()) {
                        for (list<SubtitleView>::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) {
-                               dc.DrawBitmap (*i->bitmap, i->position.x, i->position.y, true);
+                               dc.DrawBitmap (*i->bitmap, i->cropped_position.x, i->cropped_position.y, true);
                        }
                }
        }
@@ -188,7 +188,7 @@ private:
                        
                        i->cropped_image.Rescale (cropped_sub_rect.w * x_scale, cropped_sub_rect.h * y_scale, wxIMAGE_QUALITY_HIGH);
 
-                       i->position = Position (
+                       i->cropped_position = Position (
                                cropped_sub_rect.x * x_scale,
                                cropped_sub_rect.y * y_scale
                                );
@@ -216,6 +216,7 @@ private:
                              
                Position position;
                wxImage image;
+               Position cropped_position;
                wxImage cropped_image;
                shared_ptr<wxBitmap> bitmap;
        };