diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2016-11-09 09:17:03 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2016-11-09 09:17:03 +0000 |
| commit | 40c68a138368ffa620e91d7b3908e2593e424a8f (patch) | |
| tree | f907d073c1546884759d17eb1a0a05d97aeebfc9 /src/ui/tools/mesh-tool.cpp | |
| parent | Enable swapping of fill and stroke when one is a mesh. (diff) | |
| download | inkscape-40c68a138368ffa620e91d7b3908e2593e424a8f.tar.gz inkscape-40c68a138368ffa620e91d7b3908e2593e424a8f.zip | |
Click-drag selects nodes rather than creates new mesh if mesh already exists.
(bzr r15231)
Diffstat (limited to 'src/ui/tools/mesh-tool.cpp')
| -rw-r--r-- | src/ui/tools/mesh-tool.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
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 |
