Re: gdk_cairo_get_clip_rectangle and DrawingArea in ScrollableWindow
- From: "Jasper St. Pierre" <jstpierre mecheye net>
- To: "pecisk gmail com" <pecisk gmail com>
- Cc: "gtk-list gnome org" <gtk-list gnome org>
- Subject: Re: gdk_cairo_get_clip_rectangle and DrawingArea in ScrollableWindow
- Date: Sat, 30 Mar 2013 18:32:41 -0400
The clip rectangle is not necessarily the visible area. It's the exposed or damaged area. The scroll view works by copying the rendered contents a little higher up in the buffer, and then telling your drawing area to render the stuff that wasn't already on the window.
If window is resized or it loses focus, the size or style of the window changes, and everything is fully redrawn, so it can't copy any old contents of the drawing area, so it asks you to redraw the entire drawing area.
If you want to know the size to paint to, use the drawing area's allocation, gotten with gtk_widget_get_allocation. The clip rect is provided for you to do culling optimizations -- if there's a very expensive object to be rendered, if it's not in the clip rect, you can skip the expensive calculations for rendering; the clip is already set on the cairo context passed into you.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]