summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-04-05 12:34:48 +0000
committerJohn Smith <removethis.john.q.public@bigmail.com>2012-04-05 12:34:48 +0000
commitd33c52d48976eb35121b538178b11bb1247c527b (patch)
tree46125daa76a44c8942aadaf328e54d13489e80d9 /src/selection-chemistry.cpp
parentClipboard code cleaning (patch for bug #964852 by Romain, see devmail thread... (diff)
downloadinkscape-d33c52d48976eb35121b538178b11bb1247c527b.tar.gz
inkscape-d33c52d48976eb35121b538178b11bb1247c527b.zip
Fix for 170378 : Select same objects by fill or stroke : Fix transformed stroke width
(bzr r11154)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 2fe3b343f..f481a5337 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -1782,6 +1782,18 @@ GSList *sp_get_same_stroke_style(SPItem *sel, GSList *src, SPSelectStrokeStyleTy
return sp_get_same_fill_or_stroke_color(sel, src, type);
}
+ /*
+ * Stroke width needs to handle transformations, so call this function
+ * to get the transformed stroke width
+ */
+ GSList *objects = NULL;
+ SPStyle *sel_style_for_width = NULL;
+ if (type == SP_STROKE_STYLE_WIDTH) {
+ objects = g_slist_prepend(objects, sel);
+ sel_style_for_width = sp_style_new (SP_ACTIVE_DOCUMENT);
+ objects_query_strokewidth (objects, sel_style_for_width);
+ }
+
for (GSList *i = src; i != NULL; i = i->next) {
SPItem *iter = SP_ITEM(i->data);
SPStyle *iter_style = iter->style;
@@ -1790,7 +1802,15 @@ GSList *sp_get_same_stroke_style(SPItem *sel, GSList *src, SPSelectStrokeStyleTy
if (type == SP_STROKE_STYLE_WIDTH) {
match = (sel_style->stroke_width.set == iter_style->stroke_width.set);
if (sel_style->stroke_width.set && iter_style->stroke_width.set) {
- match = (sel_style->stroke_width.computed == iter_style->stroke_width.computed);
+ GSList *objects = NULL;
+ objects = g_slist_prepend(objects, iter);
+ SPStyle *iter_style_for_width = sp_style_new (SP_ACTIVE_DOCUMENT);
+ objects_query_strokewidth (objects, iter_style_for_width);
+
+ if (sel_style_for_width) {
+ match = (sel_style_for_width->stroke_width.computed == iter_style_for_width->stroke_width.computed);
+ }
+ g_slist_free(objects);
}
}
else if (type == SP_STROKE_STYLE_DASHES ) {
@@ -1825,6 +1845,8 @@ GSList *sp_get_same_stroke_style(SPItem *sel, GSList *src, SPSelectStrokeStyleTy
}
}
+ g_slist_free(objects);
+
return matches;
}