From d4432a4aaf3fb615d9808f53557a4283436bf035 Mon Sep 17 00:00:00 2001 From: Stefano Facchini Date: Sun, 1 Oct 2017 15:27:03 +0200 Subject: Fix the editing of clipping and masking objects By passing along an edit_transform matrix, as done for clipping paths. Cleanups: - remove some unused methods - use member initialization --- src/ui/shape-editor.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/ui/shape-editor.cpp') diff --git a/src/ui/shape-editor.cpp b/src/ui/shape-editor.cpp index 6a8f5e931..2c0e662ee 100644 --- a/src/ui/shape-editor.cpp +++ b/src/ui/shape-editor.cpp @@ -31,10 +31,12 @@ namespace UI { bool ShapeEditor::_blockSetItem = false; -ShapeEditor::ShapeEditor(SPDesktop *dt) { - this->desktop = dt; - this->knotholder = NULL; - this->knotholder_listener_attached_for = NULL; +ShapeEditor::ShapeEditor(SPDesktop *dt, Geom::Affine edit_transform) : + desktop(dt), + knotholder(nullptr), + knotholder_listener_attached_for(nullptr), + _edit_transform(edit_transform) +{ } ShapeEditor::~ShapeEditor() { @@ -76,14 +78,6 @@ void ShapeEditor::decrement_local_change() { } } -const SPItem *ShapeEditor::get_item() { - const SPItem *item = NULL; - if (this->has_knotholder()) { - item = this->knotholder->getItem(); - } - return item; -} - void ShapeEditor::event_attr_changed(Inkscape::XML::Node * node, gchar const *name, gchar const *, gchar const *, bool, void *data) { g_assert(data); @@ -129,6 +123,7 @@ void ShapeEditor::set_item(SPItem *item, bool keep_knotholder) { this->knotholder = createKnotHolder(item, desktop); } if (this->knotholder) { + this->knotholder->setEditTransform(_edit_transform); this->knotholder->update_knots(); // setting new listener repr = this->knotholder->repr; -- cgit v1.2.3 From 1d7b7827cef0755aa92387e48bdde4d2a9c06318 Mon Sep 17 00:00:00 2001 From: Stefano Facchini Date: Sun, 1 Oct 2017 15:47:50 +0200 Subject: Rename object-edit.cpp to what it really is --- src/ui/shape-editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui/shape-editor.cpp') diff --git a/src/ui/shape-editor.cpp b/src/ui/shape-editor.cpp index 2c0e662ee..4851c413f 100644 --- a/src/ui/shape-editor.cpp +++ b/src/ui/shape-editor.cpp @@ -20,15 +20,15 @@ #include "sp-shape.h" #include "sp-path.h" #include "inkscape.h" -#include "ui/object-edit.h" #include "ui/shape-editor.h" #include "xml/node-event-vector.h" -//using Inkscape::createKnotHolder; namespace Inkscape { namespace UI { +KnotHolder *createKnotHolder(SPItem *item, SPDesktop *desktop); + bool ShapeEditor::_blockSetItem = false; ShapeEditor::ShapeEditor(SPDesktop *dt, Geom::Affine edit_transform) : -- cgit v1.2.3