[gthumb] image selector: reduce the selection size by 0.5



commit aebbdc541848021aa9c90e7d0b52a2eb6d184a85
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon May 16 23:01:43 2011 +0200

    image selector: reduce the selection size by 0.5

 gthumb/cairo-utils.c        |    2 +-
 gthumb/gth-image-selector.c |   12 +++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/gthumb/cairo-utils.c b/gthumb/cairo-utils.c
index 81fb662..bcbfce8 100644
--- a/gthumb/cairo-utils.c
+++ b/gthumb/cairo-utils.c
@@ -787,7 +787,7 @@ _cairo_paint_grid (cairo_t      *cr,
 	/* cairo_set_operator (cr, CAIRO_OPERATOR_DIFFERENCE); */
 #endif
 
-	cairo_rectangle (cr, rectangle->x + 0.5, rectangle->y + 0.5, rectangle->width, rectangle->height);
+	cairo_rectangle (cr, rectangle->x + 0.5, rectangle->y + 0.5, rectangle->width - 0.5, rectangle->height - 0.5);
 	cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
 	cairo_stroke (cr);
 
diff --git a/gthumb/gth-image-selector.c b/gthumb/gth-image-selector.c
index fff7daf..9fad640 100644
--- a/gthumb/gth-image-selector.c
+++ b/gthumb/gth-image-selector.c
@@ -649,18 +649,16 @@ paint_selection (GthImageSelector *self,
 	_cairo_paint_grid (cr, &selection_area, self->priv->grid_type);
 
 	cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
-	cairo_rectangle (cr,
-			 selection_area.x + 0.5,
-			 selection_area.y + 0.5,
-			 selection_area.width - 1,
-			 selection_area.height - 1);
-	if ((self->priv->current_area != NULL) && (self->priv->current_area->id != C_SELECTION_AREA))
+	if ((self->priv->current_area != NULL) && (self->priv->current_area->id != C_SELECTION_AREA)) {
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 9, 2)
+		/* cairo_set_operator (cr, CAIRO_OPERATOR_DIFFERENCE); */
+#endif
 		cairo_rectangle (cr,
 				 self->priv->current_area->area.x + self->priv->viewer->image_area.x - self->priv->viewer->x_offset + 0.5,
 				 self->priv->current_area->area.y + self->priv->viewer->image_area.y - self->priv->viewer->y_offset + 0.5,
 				 self->priv->current_area->area.width - 1,
 				 self->priv->current_area->area.height - 1);
-
+	}
 	cairo_stroke (cr);
 
 	cairo_restore (cr);



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