Avoid ResetClip() since (on GTK3, and maybe elsewhere) it seems to
authorCarl Hetherington <cth@carlh.net>
Sat, 27 Jun 2020 19:45:26 +0000 (21:45 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 27 Jun 2020 19:45:26 +0000 (21:45 +0200)
reset some internally-setup clipping so that drawing can overlap
the canvas that it's on.  Fixes #1769.

src/wx/timeline_content_view.cc

index 6902a11d62633785e1f0d3dd910793e378a4a9ca..474b8d07f19554bf0bed1fda4a26c4f592089681 100644 (file)
@@ -149,9 +149,10 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
        wxDouble lab_leading;
        gc->SetFont (gc->CreateFont (*wxNORMAL_FONT, foreground_colour ()));
        gc->GetTextExtent (lab, &lab_width, &lab_height, &lab_descent, &lab_leading);
+       gc->PushState ();
        gc->Clip (wxRegion (time_x (position), y_pos (_track.get()), len.seconds() * _timeline.pixels_per_second().get_value_or(0), _timeline.pixels_per_track()));
        gc->DrawText (lab, time_x (position) + 12, y_pos (_track.get() + 1) - lab_height - 4);
-       gc->ResetClip ();
+       gc->PopState ();
 }
 
 int