From efdd60375ab3048919bde2d5f410b92626a6a712 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 29 Mar 2014 19:02:09 -0400 Subject: Documented that the clip area in AreaHandler.Paint() more properly and indicate that it is cleared on each AreaHandler.Paint() call; (try to) implement that on Windows (GTK+ does it for us; noted that as well). --- area_unix.go | 1 + 1 file changed, 1 insertion(+) (limited to 'area_unix.go') diff --git a/area_unix.go b/area_unix.go index 08dd48d..0155bdc 100644 --- a/area_unix.go +++ b/area_unix.go @@ -48,6 +48,7 @@ func our_area_draw_callback(widget *C.GtkWidget, cr *C.cairo_t, data C.gpointer) s := (*sysData)(unsafe.Pointer(data)) // thanks to desrt in irc.gimp.net/#gtk+ C.cairo_clip_extents(cr, &x, &y, &w, &h) + // we do not need to clear the cliprect; GtkDrawingArea did it for us beforehand cliprect := image.Rect(int(x), int(y), int(w), int(h)) // the cliprect can actually fall outside the size of the Area; clip it by intersecting the two rectangles C.gtk_widget_get_size_request(widget, &maxwid, &maxht) -- cgit v1.2.3