From 40c68a138368ffa620e91d7b3908e2593e424a8f Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 9 Nov 2016 10:17:03 +0100 Subject: Click-drag selects nodes rather than creates new mesh if mesh already exists. (bzr r15231) --- src/ui/tools/mesh-tool.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/ui/tools/mesh-tool.cpp') diff --git a/src/ui/tools/mesh-tool.cpp b/src/ui/tools/mesh-tool.cpp index 87cbeef16..61793b8b3 100644 --- a/src/ui/tools/mesh-tool.cpp +++ b/src/ui/tools/mesh-tool.cpp @@ -561,8 +561,25 @@ bool MeshTool::root_handler(GdkEvent* event) { dragging = true; + // Check if object already has mesh... if it does, don't create new mesh with click-drag. + bool has_mesh = false; + if (!selection->isEmpty()) { + SPStyle *style = selection->items().front()->style; + if (style) { + Inkscape::PaintTarget fill_or_stroke = + (prefs->getInt("/tools/gradient/newfillorstroke", 1) != 0) ? + Inkscape::FOR_FILL : Inkscape::FOR_STROKE; + SPPaintServer *server = + (fill_or_stroke == Inkscape::FOR_FILL) ? + style->getFillPaintServer(): + style->getStrokePaintServer(); + if (server && SP_IS_MESHGRADIENT(server)) + has_mesh = true; + } + } + Geom::Point button_dt = desktop->w2d(button_w); - if (event->button.state & GDK_SHIFT_MASK) { + if (event->button.state & GDK_SHIFT_MASK || has_mesh) { Inkscape::Rubberband::get(desktop)->start(desktop, button_dt); } else { // remember clicked item, disregarding groups, honoring Alt; do nothing with Crtl to -- cgit v1.2.3