diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-03-15 23:46:50 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-03-15 23:46:50 +0000 |
| commit | c30c698c1291f2b787c0d2bc27b15c77db1685f4 (patch) | |
| tree | 3ad2395b8decb9fccde4b609caac95a0dab3f752 /src | |
| parent | 3584157f1c3891259da0f86ea933f390449ad657 (diff) | |
Draw 'masking' even when there's no _frame; stops a jump in the
size of the image when doing play-to-end, then play; in this case
we start playing again, _frame goes to 0 and we stop.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/film_viewer.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 0e47ac1ac..b99bea6f7 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -349,33 +349,33 @@ FilmViewer::paint_panel () if (!_out_size.width || !_out_size.height || !_film || !_frame || _out_size != _frame->size()) { dc.Clear (); - return; - } + } else { - wxImage frame (_out_size.width, _out_size.height, _frame->data()[0], true); - wxBitmap frame_bitmap (frame); - dc.DrawBitmap (frame_bitmap, 0, max(0, (_panel_size.height - _out_size.height) / 2)); + wxImage frame (_out_size.width, _out_size.height, _frame->data()[0], true); + wxBitmap frame_bitmap (frame); + dc.DrawBitmap (frame_bitmap, 0, max(0, (_panel_size.height - _out_size.height) / 2)); #ifdef DCPOMATIC_VARIANT_SWAROOP - DCPTime const period = DCPTime::from_seconds(Config::instance()->player_watermark_period() * 60); - int64_t n = _video_position.get() / period.get(); - DCPTime from(n * period.get()); - DCPTime to = from + DCPTime::from_seconds(Config::instance()->player_watermark_duration() / 1000.0); - if (from <= _video_position && _video_position <= to) { - if (!_in_watermark) { - _in_watermark = true; - _watermark_x = rand() % _panel_size.width; - _watermark_y = rand() % _panel_size.height; + DCPTime const period = DCPTime::from_seconds(Config::instance()->player_watermark_period() * 60); + int64_t n = _video_position.get() / period.get(); + DCPTime from(n * period.get()); + DCPTime to = from + DCPTime::from_seconds(Config::instance()->player_watermark_duration() / 1000.0); + if (from <= _video_position && _video_position <= to) { + if (!_in_watermark) { + _in_watermark = true; + _watermark_x = rand() % _panel_size.width; + _watermark_y = rand() % _panel_size.height; + } + dc.SetTextForeground(*wxWHITE); + string wm = Config::instance()->player_watermark_theatre(); + boost::posix_time::ptime t = boost::posix_time::second_clock::local_time(); + wm += "\n" + boost::posix_time::to_iso_extended_string(t); + dc.DrawText(std_to_wx(wm), _watermark_x, _watermark_y); + } else { + _in_watermark = false; } - dc.SetTextForeground(*wxWHITE); - string wm = Config::instance()->player_watermark_theatre(); - boost::posix_time::ptime t = boost::posix_time::second_clock::local_time(); - wm += "\n" + boost::posix_time::to_iso_extended_string(t); - dc.DrawText(std_to_wx(wm), _watermark_x, _watermark_y); - } else { - _in_watermark = false; - } #endif + } if (_out_size.width < _panel_size.width) { /* XXX: these colours are right for GNOME; may need adjusting for other OS */ |
