summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-07 17:50:35 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-07 18:10:53 +0100
commitfb55f810414893a1bad62abd03e5202aa42028c1 (patch)
tree52ccc503599c4fec116146d54d5c0e47b46a1a38 /src
parent3366004130c2434dfe6972b36ad090ac2a8b8005 (diff)
Hopefully fix lack of background redraw of film viewer on Windows (#86).
Diffstat (limited to 'src')
-rw-r--r--src/wx/film_editor.cc2
-rw-r--r--src/wx/film_viewer.cc31
-rw-r--r--src/wx/film_viewer.h2
3 files changed, 17 insertions, 18 deletions
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index 69f09c880..eb36ce1ff 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -148,7 +148,7 @@ FilmEditor::make_film_panel ()
}
++r;
- _frame_rate_description = new wxStaticText (_film_panel, wxID_ANY, wxT (" \n "), wxDefaultPosition, wxDefaultSize);
+ _frame_rate_description = new wxStaticText (_film_panel, wxID_ANY, wxT (" \n \n "), wxDefaultPosition, wxDefaultSize);
grid->Add (video_control (_frame_rate_description), wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
wxFont font = _frame_rate_description->GetFont();
font.SetStyle(wxFONTSTYLE_ITALIC);
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 08eade4d0..4dca5cad8 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -54,7 +54,6 @@ FilmViewer::FilmViewer (shared_ptr<Film> f, wxWindow* p)
, _play_button (new wxToggleButton (this, wxID_ANY, _("Play")))
, _display_frame_x (0)
, _got_frame (false)
- , _clear_required (false)
{
_panel->SetDoubleBuffered (true);
#if wxMAJOR_VERSION == 2 && wxMINOR_VERSION >= 9
@@ -201,11 +200,6 @@ FilmViewer::paint_panel (wxPaintEvent &)
{
wxPaintDC dc (_panel);
- if (_clear_required) {
- dc.Clear ();
- _clear_required = false;
- }
-
if (!_display_frame || !_film || !_out_size.width || !_out_size.height) {
dc.Clear ();
return;
@@ -227,6 +221,22 @@ FilmViewer::paint_panel (wxPaintEvent &)
wxBitmap sub_bitmap (sub);
dc.DrawBitmap (sub_bitmap, _display_sub_position.x, _display_sub_position.y);
}
+
+ if (_film_size.width < _panel_size.width) {
+ wxPen p (GetBackgroundColour ());
+ wxBrush b (GetBackgroundColour ());
+ dc.SetPen (p);
+ dc.SetBrush (b);
+ dc.DrawRectangle (_film_size.width, 0, _panel_size.width - _film_size.width, _panel_size.height);
+ }
+
+ if (_film_size.height < _panel_size.height) {
+ wxPen p (GetBackgroundColour ());
+ wxBrush b (GetBackgroundColour ());
+ dc.SetPen (p);
+ dc.SetBrush (b);
+ dc.DrawRectangle (0, _film_size.height, _panel_size.width, _panel_size.height - _film_size.height);
+ }
}
@@ -275,11 +285,6 @@ FilmViewer::raw_to_display ()
return;
}
- libdcp::Size old_size;
- if (_display_frame) {
- old_size = _display_frame->size();
- }
-
boost::shared_ptr<Image> input = _raw_frame;
pair<string, string> const s = Filter::ffmpeg_strings (_film->filters());
@@ -290,10 +295,6 @@ FilmViewer::raw_to_display ()
/* Get a compacted image as we have to feed it to wxWidgets */
_display_frame = input->scale_and_convert_to_rgb (_film_size, 0, _film->scaler(), false);
- if (old_size != _display_frame->size()) {
- _clear_required = true;
- }
-
if (_raw_sub) {
/* Our output is already cropped by the decoder, so we need to account for that
diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h
index 456301eb4..f89269d2b 100644
--- a/src/wx/film_viewer.h
+++ b/src/wx/film_viewer.h
@@ -80,6 +80,4 @@ private:
libdcp::Size _film_size;
/** Size of the panel that we have available */
libdcp::Size _panel_size;
-
- bool _clear_required;
};