From 1636c1dd1651780d01759676b194312529f211f7 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Sat, 25 Jun 2016 22:24:26 +0200 Subject: Moved next functions, added namespace, renamed range functions (bzr r14954.1.10) --- src/ui/tools/node-tool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui/tools/node-tool.cpp') diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index 23aaf6bb1..f7a725794 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -407,7 +407,7 @@ void NodeTool::selection_changed(Inkscape::Selection *sel) { std::set shapes; - std::vector items=sel->itemList(); + std::vector items= sel->items(); for(std::vector::const_iterator i=items.begin();i!=items.end();++i){ SPObject *obj = *i; @@ -444,7 +444,7 @@ void NodeTool::selection_changed(Inkscape::Selection *sel) { } _previous_selection = _current_selection; - _current_selection = sel->itemList(); + _current_selection = sel->items(); this->_multipath->setItems(shapes); this->update_tip(NULL); -- cgit v1.2.3 From 9e210a6d1333c3366681547e3e81593ef69ff73e Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Jul 2016 12:56:49 +0200 Subject: Last part of new SPObject children list (bzr r14954.1.20) --- src/ui/tools/node-tool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui/tools/node-tool.cpp') diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index 736dafa50..3dfac5e3d 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -378,8 +378,8 @@ void gather_items(NodeTool *nt, SPItem *base, SPObject *obj, Inkscape::UI::Shape r.role = role; s.insert(r); } else if (role != SHAPE_ROLE_NORMAL && (SP_IS_GROUP(obj) || SP_IS_OBJECTGROUP(obj))) { - for (SPObject *c = obj->children; c; c = c->next) { - gather_items(nt, base, c, role, s); + for (auto& c: obj->_children) { + gather_items(nt, base, &c, role, s); } } else if (SP_IS_ITEM(obj)) { SPItem *item = static_cast(obj); -- cgit v1.2.3 From 24d3f50003ca3cec6a03a7f5267cc4fe5588c69f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Jul 2016 13:17:21 +0200 Subject: Renamed children list in SPObject (bzr r14954.1.21) --- src/ui/tools/node-tool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/tools/node-tool.cpp') diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index 3dfac5e3d..87b7bf7e3 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -378,7 +378,7 @@ void gather_items(NodeTool *nt, SPItem *base, SPObject *obj, Inkscape::UI::Shape r.role = role; s.insert(r); } else if (role != SHAPE_ROLE_NORMAL && (SP_IS_GROUP(obj) || SP_IS_OBJECTGROUP(obj))) { - for (auto& c: obj->_children) { + for (auto& c: obj->children) { gather_items(nt, base, &c, role, s); } } else if (SP_IS_ITEM(obj)) { -- cgit v1.2.3 From f35bb1f74a0ffeb5c6477a25e3c4cde87a97bcf1 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 12:06:06 +0200 Subject: Removed unused includes, decrease compilation time (bzr r15025) --- src/ui/tools/node-tool.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/ui/tools/node-tool.cpp') diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index 23aaf6bb1..bf18d4a2e 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -24,25 +24,19 @@ #include "message-context.h" #include "selection.h" #include "ui/shape-editor.h" // temporary! -#include "live_effects/effect.h" -#include "display/curve.h" #include "snap.h" #include "sp-namedview.h" #include "sp-clippath.h" #include "sp-item-group.h" #include "sp-mask.h" -#include "sp-object-group.h" -#include "sp-path.h" #include "sp-text.h" #include "ui/control-manager.h" #include "ui/tools/node-tool.h" #include "ui/tool/control-point-selection.h" #include "ui/tool/event-utils.h" -#include "ui/tool/manipulator.h" #include "ui/tool/multi-path-manipulator.h" #include "ui/tool/path-manipulator.h" #include "ui/tool/selector.h" -#include "ui/tool/shape-record.h" #include "pixmaps/cursor-node.xpm" #include "pixmaps/cursor-node-d.xpm" -- cgit v1.2.3 From 43b49e325db73cc19b1731db6c69545664ee8fbe Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 13:26:17 +0200 Subject: Reverted changes to r15024 after many building problems (bzr r15027) --- src/ui/tools/node-tool.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ui/tools/node-tool.cpp') diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index bf18d4a2e..23aaf6bb1 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -24,19 +24,25 @@ #include "message-context.h" #include "selection.h" #include "ui/shape-editor.h" // temporary! +#include "live_effects/effect.h" +#include "display/curve.h" #include "snap.h" #include "sp-namedview.h" #include "sp-clippath.h" #include "sp-item-group.h" #include "sp-mask.h" +#include "sp-object-group.h" +#include "sp-path.h" #include "sp-text.h" #include "ui/control-manager.h" #include "ui/tools/node-tool.h" #include "ui/tool/control-point-selection.h" #include "ui/tool/event-utils.h" +#include "ui/tool/manipulator.h" #include "ui/tool/multi-path-manipulator.h" #include "ui/tool/path-manipulator.h" #include "ui/tool/selector.h" +#include "ui/tool/shape-record.h" #include "pixmaps/cursor-node.xpm" #include "pixmaps/cursor-node-d.xpm" -- cgit v1.2.3 From 35830f456cadaecf8b8e3944e3031a1a93f6cb41 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 3 Aug 2016 15:29:38 +0200 Subject: Removed unused includes, decreased compilation time. Once again (bzr r15034) --- src/ui/tools/node-tool.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/ui/tools/node-tool.cpp') diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index 23aaf6bb1..bf18d4a2e 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -24,25 +24,19 @@ #include "message-context.h" #include "selection.h" #include "ui/shape-editor.h" // temporary! -#include "live_effects/effect.h" -#include "display/curve.h" #include "snap.h" #include "sp-namedview.h" #include "sp-clippath.h" #include "sp-item-group.h" #include "sp-mask.h" -#include "sp-object-group.h" -#include "sp-path.h" #include "sp-text.h" #include "ui/control-manager.h" #include "ui/tools/node-tool.h" #include "ui/tool/control-point-selection.h" #include "ui/tool/event-utils.h" -#include "ui/tool/manipulator.h" #include "ui/tool/multi-path-manipulator.h" #include "ui/tool/path-manipulator.h" #include "ui/tool/selector.h" -#include "ui/tool/shape-record.h" #include "pixmaps/cursor-node.xpm" #include "pixmaps/cursor-node-d.xpm" -- cgit v1.2.3 From e1a84ff6c44588f7847258b5eb5266365e0738e1 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 29 Aug 2016 15:27:55 +0200 Subject: Fixes to helper paths. evaluate backport to 0.92.x (bzr r15086) --- src/ui/tools/node-tool.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/ui/tools/node-tool.cpp') diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index f7f09610c..99c98476f 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -158,6 +158,9 @@ NodeTool::~NodeTool() { if (this->helperpath_tmpitem) { this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem); } + if (this->helperpath_tmpitem_highlight) { + this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem_highlight); + } this->_selection_changed_connection.disconnect(); //this->_selection_modified_connection.disconnect(); this->_mouseover_changed_connection.disconnect(); @@ -238,13 +241,13 @@ void NodeTool::setup() { ); this->helperpath_tmpitem = NULL; + this->helperpath_tmpitem_highlight = NULL; this->cursor_drag = false; this->show_transform_handles = true; this->single_node_transform_handles = false; this->flash_tempitem = NULL; this->flashed_item = NULL; this->_last_over = NULL; - this->helperpath_tmpitem = NULL; // read prefs before adding items to selection to prevent momentarily showing the outline sp_event_context_read(this, "show_handles"); @@ -271,7 +274,7 @@ void NodeTool::setup() { } this->desktop->emitToolSubselectionChanged(NULL); // sets the coord entry fields to inactive - this->update_helperpath(); + update_helperpath(); } // show helper paths of the applied LPE, if any @@ -282,6 +285,10 @@ void NodeTool::update_helperpath () { this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem); this->helperpath_tmpitem = NULL; } + if (this->helperpath_tmpitem_highlight) { + this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem_highlight); + this->helperpath_tmpitem_highlight = NULL; + } if (SP_IS_LPE_ITEM(selection->singleItem())) { Inkscape::LivePathEffect::Effect *lpe = SP_LPE_ITEM(selection->singleItem())->getCurrentLPE(); @@ -305,6 +312,11 @@ void NodeTool::update_helperpath () { cc->reset(); } if (!c->is_empty()) { + SPCanvasItem *helperpath_highlight = sp_canvas_bpath_new(this->desktop->getTempGroup(), c); + sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(helperpath_highlight), 0xffffff9A, 2.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); + sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(helperpath_highlight), 0, SP_WIND_RULE_NONZERO); + sp_canvas_item_affine_absolute(helperpath_highlight, selection->singleItem()->i2dt_affine()); + this->helperpath_tmpitem_highlight = this->desktop->add_temporary_canvasitem(helperpath_highlight, 0); SPCanvasItem *helperpath = sp_canvas_bpath_new(this->desktop->getTempGroup(), c); sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(helperpath), 0x0000ff9A, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(helperpath), 0, SP_WIND_RULE_NONZERO); @@ -468,13 +480,10 @@ bool NodeTool::root_handler(GdkEvent* event) { if (this->_selected_nodes->event(this, event)) { return true; } - switch (event->type) { case GDK_MOTION_NOTIFY: { - this->update_helperpath(); combine_motion_events(desktop->canvas, event->motion, 0); - this->update_helperpath(); SPItem *over_item = sp_event_context_find_item (desktop, event_point(event->button), FALSE, TRUE); @@ -629,7 +638,6 @@ bool NodeTool::root_handler(GdkEvent* event) { void NodeTool::update_tip(GdkEvent *event) { using namespace Inkscape::UI; - if (event && (event->type == GDK_KEY_PRESS || event->type == GDK_KEY_RELEASE)) { unsigned new_state = state_after_event(event); -- cgit v1.2.3 From 3a70c702b97414c4508c6871462d1fa4f1433ad7 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 29 Aug 2016 18:15:30 +0200 Subject: Add comment and fix in helper paths (bzr r15087) --- src/ui/tools/node-tool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/tools/node-tool.cpp') diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index 99c98476f..c266db05c 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -274,7 +274,7 @@ void NodeTool::setup() { } this->desktop->emitToolSubselectionChanged(NULL); // sets the coord entry fields to inactive - update_helperpath(); + this->update_helperpath(); } // show helper paths of the applied LPE, if any -- cgit v1.2.3 From 1b8b972f1e0d6ee32c1f85514ec334c654d1e29c Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 29 Aug 2016 22:39:07 +0200 Subject: Partial fix for bug 172063 while we find a better solution for XOR in helper lines (bzr r15090) --- src/ui/tools/node-tool.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/ui/tools/node-tool.cpp') diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index c266db05c..b4fc569bb 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -158,9 +158,6 @@ NodeTool::~NodeTool() { if (this->helperpath_tmpitem) { this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem); } - if (this->helperpath_tmpitem_highlight) { - this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem_highlight); - } this->_selection_changed_connection.disconnect(); //this->_selection_modified_connection.disconnect(); this->_mouseover_changed_connection.disconnect(); @@ -241,7 +238,6 @@ void NodeTool::setup() { ); this->helperpath_tmpitem = NULL; - this->helperpath_tmpitem_highlight = NULL; this->cursor_drag = false; this->show_transform_handles = true; this->single_node_transform_handles = false; @@ -285,10 +281,6 @@ void NodeTool::update_helperpath () { this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem); this->helperpath_tmpitem = NULL; } - if (this->helperpath_tmpitem_highlight) { - this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem_highlight); - this->helperpath_tmpitem_highlight = NULL; - } if (SP_IS_LPE_ITEM(selection->singleItem())) { Inkscape::LivePathEffect::Effect *lpe = SP_LPE_ITEM(selection->singleItem())->getCurrentLPE(); @@ -312,12 +304,7 @@ void NodeTool::update_helperpath () { cc->reset(); } if (!c->is_empty()) { - SPCanvasItem *helperpath_highlight = sp_canvas_bpath_new(this->desktop->getTempGroup(), c); - sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(helperpath_highlight), 0xffffff9A, 2.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); - sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(helperpath_highlight), 0, SP_WIND_RULE_NONZERO); - sp_canvas_item_affine_absolute(helperpath_highlight, selection->singleItem()->i2dt_affine()); - this->helperpath_tmpitem_highlight = this->desktop->add_temporary_canvasitem(helperpath_highlight, 0); - SPCanvasItem *helperpath = sp_canvas_bpath_new(this->desktop->getTempGroup(), c); + SPCanvasItem *helperpath = sp_canvas_bpath_new(this->desktop->getTempGroup(), c, true); sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(helperpath), 0x0000ff9A, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(helperpath), 0, SP_WIND_RULE_NONZERO); sp_canvas_item_affine_absolute(helperpath, selection->singleItem()->i2dt_affine()); -- cgit v1.2.3 From 5cb8c080df223593fbae945178da3e500fe762c6 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 29 Aug 2016 23:13:26 +0200 Subject: Add phantom bpath to helper (bzr r15092) --- src/ui/tools/node-tool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/tools/node-tool.cpp') diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index b4fc569bb..2bd4fdea3 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -523,7 +523,7 @@ bool NodeTool::root_handler(GdkEvent* event) { } c->transform(over_item->i2dt_affine()); - SPCanvasItem *flash = sp_canvas_bpath_new(desktop->getTempGroup(), c); + SPCanvasItem *flash = sp_canvas_bpath_new(desktop->getTempGroup(), c, true); sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(flash), //prefs->getInt("/tools/nodes/highlight_color", 0xff0000ff), 1.0, -- cgit v1.2.3