diff --git a/include/DrawingAreaVisualDisk.h b/include/DrawingAreaVisualDisk.h index d7f6ee49..226051dd 100644 --- a/include/DrawingAreaVisualDisk.h +++ b/include/DrawingAreaVisualDisk.h @@ -65,7 +65,7 @@ private: int spreadout_leftover_px( std::vector & visual_partitions, int pixels ) ; //overridden signalhandlers - bool on_expose_event( GdkEventExpose * event ) ; + bool on_draw(const Cairo::RefPtr& cr); bool on_button_press_event( GdkEventButton * event ) ; void on_size_allocate( Gtk::Allocation & allocation ) ; diff --git a/src/DrawingAreaVisualDisk.cc b/src/DrawingAreaVisualDisk.cc index 2b0069ff..6589a842 100644 --- a/src/DrawingAreaVisualDisk.cc +++ b/src/DrawingAreaVisualDisk.cc @@ -314,21 +314,9 @@ void DrawingAreaVisualDisk::set_selected( const std::vector & } -bool DrawingAreaVisualDisk::on_expose_event( GdkEventExpose * event ) +bool DrawingAreaVisualDisk::on_draw(const Cairo::RefPtr& cr) { - bool ret_val = Gtk::DrawingArea::on_expose_event( event ) ; - - Glib::RefPtr window = get_window(); - if (!window) - return true; - - Cairo::RefPtr cr = window->create_cairo_context(); - - // Clip to the area indicated by the expose event so that we only redraw - // the portion of the window that needs to be redrawn. - cr->rectangle(event->area.x, event->area.y, - event->area.width, event->area.height); - cr->clip(); + bool ret_val = Gtk::DrawingArea::on_draw(cr); cr->set_line_width(2.0); cr->set_line_join(Cairo::LINE_JOIN_MITER); // default