From: Jim Evins Date: Mon, 31 May 2010 02:58:33 +0000 (-0400) Subject: Fix selection problem. X-Git-Tag: glabels-2_3_0~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=55b7dda6b69c4f1a25734152fd6b69b72ee3f385;p=glabels Fix selection problem. Clear existing paths before creating new test paths. This would occasionally cause the wrong object to be selected because the in_fill or in_stroke tests would be satisfied using left-over paths from previous tests. --- diff --git a/src/label-barcode.c b/src/label-barcode.c index 0e12b3d4..fe108fd0 100644 --- a/src/label-barcode.c +++ b/src/label-barcode.c @@ -566,6 +566,7 @@ object_at (glLabelObject *object, gl_label_object_get_size (object, &w, &h); + cairo_new_path (cr); cairo_rectangle (cr, 0.0, 0.0, w, h); if (cairo_in_fill (cr, x, y)) diff --git a/src/label-box.c b/src/label-box.c index 2d714f8b..3088ef10 100644 --- a/src/label-box.c +++ b/src/label-box.c @@ -477,6 +477,7 @@ object_at (glLabelObject *object, gl_label_object_get_size (object, &w, &h); + cairo_new_path (cr); cairo_rectangle (cr, 0.0, 0.0, w, h); if (cairo_in_fill (cr, x, y)) diff --git a/src/label-ellipse.c b/src/label-ellipse.c index 6dbc7890..5de25a72 100644 --- a/src/label-ellipse.c +++ b/src/label-ellipse.c @@ -478,6 +478,7 @@ object_at (glLabelObject *object, gl_label_object_get_size (object, &w, &h); + cairo_new_path (cr); gl_cairo_ellipse_path (cr, w/2, h/2); if (cairo_in_fill (cr, x, y)) diff --git a/src/label-image.c b/src/label-image.c index b24d1a76..f9573513 100644 --- a/src/label-image.c +++ b/src/label-image.c @@ -459,6 +459,7 @@ object_at (glLabelObject *object, gl_label_object_get_size (object, &w, &h); + cairo_new_path (cr); cairo_rectangle (cr, 0.0, 0.0, w, h); if (cairo_in_fill (cr, x, y)) diff --git a/src/label-line.c b/src/label-line.c index 0b58815c..e8b66e95 100644 --- a/src/label-line.c +++ b/src/label-line.c @@ -386,6 +386,7 @@ object_at (glLabelObject *object, gl_label_object_get_size (object, &w, &h); + cairo_new_path (cr); cairo_move_to (cr, 0, 0); cairo_line_to (cr, w, h); diff --git a/src/label-text.c b/src/label-text.c index 7206bedd..1cb38ae5 100644 --- a/src/label-text.c +++ b/src/label-text.c @@ -1208,6 +1208,7 @@ object_at (glLabelObject *object, if ( (x >= 0) && (x <= w) && (y >= 0) && (y <= h) ) { + cairo_new_path (cr); set_text_path (GL_LABEL_TEXT (object), cr, TRUE, NULL); if (cairo_in_fill (cr, x, y)) { @@ -1217,6 +1218,7 @@ object_at (glLabelObject *object, if (gl_label_object_is_selected (object)) { + cairo_new_path (cr); cairo_rectangle (cr, 0, 0, w, h); if (cairo_in_stroke (cr, x, y)) {