diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-09-14 20:37:55 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-09-14 20:37:55 +0000 |
| commit | 09c1fee60bcd713fe66178021053d59e3f649660 (patch) | |
| tree | 29bba69aff0b2dda74ec6966013430aa610a066f /src | |
| parent | Merge from trunk. (diff) | |
| download | inkscape-09c1fee60bcd713fe66178021053d59e3f649660.tar.gz inkscape-09c1fee60bcd713fe66178021053d59e3f649660.zip | |
Fix bug with tool handles during document unit change.
(bzr r12475.1.17)
Diffstat (limited to 'src')
| -rw-r--r-- | src/shape-editor.cpp | 6 | ||||
| -rw-r--r-- | src/shape-editor.h | 3 | ||||
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 9 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp index 71018d89b..59d43f24c 100644 --- a/src/shape-editor.cpp +++ b/src/shape-editor.cpp @@ -35,6 +35,8 @@ using Inkscape::createKnotHolder; +bool ShapeEditor::_blockSetItem = false; + ShapeEditor::ShapeEditor(SPDesktop *dt) { this->desktop = dt; this->knotholder = NULL; @@ -169,6 +171,10 @@ static Inkscape::XML::NodeEventVector shapeeditor_repr_events = { void ShapeEditor::set_item(SPItem *item, SubType type, bool keep_knotholder) { + if (_blockSetItem) { + return; + } + // this happens (and should only happen) when for an LPEItem having both knotholder and // nodepath the knotholder is adapted; in this case we don't want to delete the knotholder // since this freezes the handles diff --git a/src/shape-editor.h b/src/shape-editor.h index 206ff269b..9b3771fee 100644 --- a/src/shape-editor.h +++ b/src/shape-editor.h @@ -65,11 +65,14 @@ public: void shapeeditor_event_attr_changed(gchar const *name); bool knot_mouseover(); + + static void blockSetItem(bool b) {_blockSetItem = b;} private: bool has_knotholder (); void reset_item (SubType type, bool keep_knotholder = true); const SPItem *get_item (SubType type); + static bool _blockSetItem; SPDesktop *desktop; KnotHolder *knotholder; diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 1b2761b13..0c39876ea 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -31,11 +31,13 @@ #include "inkscape.h" #include "io/sys.h" #include "preferences.h" +#include "shape-editor.h" #include "sp-namedview.h" #include "sp-object-repr.h" #include "sp-root.h" #include "sp-script.h" #include "svg/stringstream.h" +#include "tools-switch.h" #include "ui/widget/color-picker.h" #include "ui/widget/scalar-unit.h" #include "ui/dialog/filedialog.h" @@ -1658,9 +1660,16 @@ void DocumentProperties::onDocUnitChange() Inkscape::Util::Quantity height = doc->getHeight(); doc->setViewBox(Geom::Rect::from_xywh(0, 0, width.value(doc_unit), height.value(doc_unit))); + // TODO: Fix bug in nodes tool instead of switching away from it + if (tools_active(getDesktop()) == TOOLS_NODES) { + tools_switch(getDesktop(), TOOLS_SELECT); + } + // Scale and translate objects gdouble scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit); + ShapeEditor::blockSetItem(true); doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, doc->getHeight().value("px"))); + ShapeEditor::blockSetItem(false); doc->setModifiedSinceSave(); |
