From 55b7dda6b69c4f1a25734152fd6b69b72ee3f385 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sun, 30 May 2010 22:58:33 -0400 Subject: [PATCH] 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. --- src/label-barcode.c | 1 + src/label-box.c | 1 + src/label-ellipse.c | 1 + src/label-image.c | 1 + src/label-line.c | 1 + src/label-text.c | 2 ++ 6 files changed, 7 insertions(+) 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)) { -- 2.39.5