From: Carl Hetherington Date: Sat, 27 Jun 2020 19:45:26 +0000 (+0200) Subject: Avoid ResetClip() since (on GTK3, and maybe elsewhere) it seems to X-Git-Tag: v2.15.85~8 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=8ade2fa07a6cf99210b48dd56df050505885ad92;hp=6076bdf28d75ce00c007ac9c21e48dacedbe31c1;p=dcpomatic.git Avoid ResetClip() since (on GTK3, and maybe elsewhere) it seems to reset some internally-setup clipping so that drawing can overlap the canvas that it's on. Fixes #1769. --- diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc index 6902a11d6..474b8d07f 100644 --- a/src/wx/timeline_content_view.cc +++ b/src/wx/timeline_content_view.cc @@ -149,9 +149,10 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list 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