From dfe985fd55525f83154b1df0aa46b8abd1d9d0dc Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Sat, 10 Apr 2010 20:47:35 +0200 Subject: [PATCH] [AdgGtkArea] Do not overwrite the canvas global matrix When adjusting the canvas in the size_request() phase, change the global matrix with adg_entity_transform_global_matrix() instead of forcibly overwrite its value with adg_entity_set_global_matrix(). --- src/adg-gtk/adg-gtk-area.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/adg-gtk/adg-gtk-area.c b/src/adg-gtk/adg-gtk-area.c index 70ed35b8..676edfe2 100644 --- a/src/adg-gtk/adg-gtk-area.c +++ b/src/adg-gtk/adg-gtk-area.c @@ -24,11 +24,23 @@ * an #AdgCanvas entity * * This is a #GtkDrawingArea derived object that provides an easy way - * to show an ADG based canvas. Its default implementation reacts to - * some mouse events: if you drag the mouse while keeping the wheel - * pressed, the canvas will be translated; if the mouse wheel is rotated, - * the canvas will be scaled up or down (accordingly to the wheel - * direction) by the factor specified in the #AdgGtkArea:factor property. + * to show an ADG based canvas. The associated canvas can be set + * directly with the adg_gtk_area_new_with_canvas() constructor + * function or by using adg_gtk_area_set_canvas(). + * + * The default minimum size of this widget will depend on the canvas + * content. The global matrix of the #AdgCanvas will be adjusted to + * expose the drawing in the proper position. The empty space around + * the drawing can be changed by setting the #AdgGtkArea:top-margin, + * #AdgGtkArea:right-margin, #AdgGtkArea:bottom-margin and + * #AdgGtkArea:left-margin properties or by using the equivalent + * setter methods. + * + * The default implementation reacts to some mouse events: if you drag + * the mouse keeping the wheel pressed the canvas will be translated; + * if the mouse wheel is rotated the canvas will be scaled up or down + * (accordingly to the wheel direction) by the factor specified in the + * #AdgGtkArea:factor property. **/ /** @@ -619,7 +631,7 @@ _adg_size_request(GtkWidget *widget, GtkRequisition *requisition) cairo_matrix_init_translate(&map, -extents->org.x + data->left_padding, -extents->org.y + data->top_padding); - adg_entity_set_global_map(entity, &map); + adg_entity_transform_global_map(entity, &map, ADG_TRANSFORM_AFTER); requisition->width = extents->size.x + data->left_padding + data->right_padding; -- 2.11.4.GIT