AA gnome canvas



Hello,

The patch proposed here should correct two problems :
1- When we have a AA canvas already displayed and we want to create a new object, it is not displayed after its creation (just a problem with the clipping zone...) 2- When we create an object and we move it just after its creation, the object is not displayed (the canvas updates the rectangle where the object is defined, not the rectangle where it is moved to...)

So, the file joined tries to correct those problems. I hope it will be helpful...
--- gnome-libs-1.2.13/libgnomeui/gnome-canvas.c	Mon Jan  8 18:51:06 2001
+++ gnome-libs-1.2.13.David/libgnomeui/gnome-canvas.c	Tue Jun 12 14:34:50 2001
@@ -245,13 +245,28 @@ gnome_canvas_item_newv (GnomeCanvasGroup
 static void
 item_post_create_setup (GnomeCanvasItem *item)
 {
+        double tx1, ty1, tx2, ty2;
+        int x1, y1, x2, y2;
 	GtkObject *obj;
 
 	obj = GTK_OBJECT (item);
 
 	group_add (GNOME_CANVAS_GROUP (item->parent), item);
 
-	gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2 + 1, item->y2 + 1);
+	if (GNOME_CANVAS_ITEM_CLASS (item->object.klass)->bounds) {
+		(* GNOME_CANVAS_ITEM_CLASS (item->object.klass)->bounds) (
+                                     item, &tx1, &ty1, &tx2, &ty2);
+
+                gnome_canvas_item_i2w (item, &tx1, &ty1);
+                gnome_canvas_item_i2w (item, &tx2, &ty2);
+
+                gnome_canvas_w2c (item->canvas, tx1, ty1, &x1, &y1);
+                gnome_canvas_w2c (item->canvas, tx2, ty2, &x2, &y2);
+        }
+        else
+                x1 = y1 = x2 = y2 = 0;
+
+	gnome_canvas_request_redraw (item->canvas, x1, y1, x2 + 1, y2 + 1);
 	item->canvas->need_repick = TRUE;
 }
 
@@ -446,6 +461,7 @@ gnome_canvas_item_invoke_update (GnomeCa
 #endif
 
 	child_flags = flags;
+        
 	if (!(item->object.flags & GNOME_CANVAS_ITEM_VISIBLE))
 		child_flags &= ~GNOME_CANVAS_UPDATE_IS_VISIBLE;
 
@@ -645,6 +661,8 @@ gnome_canvas_item_setv (GnomeCanvasItem 
 void
 gnome_canvas_item_affine_relative (GnomeCanvasItem *item, const double affine[6])
 {
+	double tx1, ty1, tx2, ty2;
+        int x1, y1, x2, y2;
 	double *new_affine;
 	int i;
 
@@ -699,8 +717,25 @@ gnome_canvas_item_affine_relative (Gnome
 
 	if (!(item->object.flags & GNOME_CANVAS_ITEM_NEED_AFFINE)) {
 		item->object.flags |= GNOME_CANVAS_ITEM_NEED_AFFINE;
-		if (item->parent != NULL)
+		if (item->parent != NULL) {
+                        if(item->parent->object.flags & GNOME_CANVAS_ITEM_NEED_UPDATE)
+                           	if (GNOME_CANVAS_ITEM_CLASS (item->object.klass)->bounds) {
+                                        (* GNOME_CANVAS_ITEM_CLASS (item->object.klass)->bounds) (
+                                                                                                  item, &tx1, &ty1, &tx2, &ty2);
+
+                                        gnome_canvas_item_i2w (item, &tx1, &ty1);
+                                        gnome_canvas_item_i2w (item, &tx2, &ty2);
+
+                                        gnome_canvas_w2c (item->canvas, tx1, ty1, &x1, &y1);
+                                        gnome_canvas_w2c (item->canvas, tx2, ty2, &x2, &y2);
+                                }
+                                else
+                                        x1 = y1 = x2 = y2 = 0;
+
+                        gnome_canvas_request_redraw (item->canvas, x1, y1, x2 + 1, y2 + 1);
+
 			gnome_canvas_item_request_update (item->parent);
+                }
 		else
 			gnome_canvas_request_update (item->canvas);
 	}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]