diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2009-12-08 02:21:08 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2009-12-08 02:21:08 +0000 |
| commit | e2b9f78d271e5fea988138d49020e704e72c83b1 (patch) | |
| tree | d5c1c53cefce4a2f126718cdf2d95707309446e5 /src/live_effects | |
| parent | Fix mask editing behavior on undo and outline display for masks/clips; (diff) | |
| download | inkscape-e2b9f78d271e5fea988138d49020e704e72c83b1.tar.gz inkscape-e2b9f78d271e5fea988138d49020e704e72c83b1.zip | |
Fix LPEs and break mask transform undo
(bzr r8846.2.3)
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/effect.cpp | 7 | ||||
| -rw-r--r-- | src/live_effects/effect.h | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-constructgrid.cpp | 7 | ||||
| -rw-r--r-- | src/live_effects/lpe-constructgrid.h | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-gears.cpp | 7 | ||||
| -rw-r--r-- | src/live_effects/lpe-gears.h | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-spiro.cpp | 8 | ||||
| -rw-r--r-- | src/live_effects/lpe-spiro.h | 1 | ||||
| -rw-r--r-- | src/live_effects/lpe-vonkoch.cpp | 6 | ||||
| -rw-r--r-- | src/live_effects/parameter/path.cpp | 33 |
10 files changed, 30 insertions, 45 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 9232792f6..dfa9fe6b2 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -665,13 +665,6 @@ Effect::resetDefaults(SPItem * /*item*/) } void -Effect::setup_nodepath(Inkscape::NodePath::Path *np) -{ - np->helperpath_rgba = 0xff0000ff; - np->helperpath_width = 1.0; -} - -void Effect::transform_multiply(Geom::Matrix const& postmul, bool set) { // cycle through all parameters. Most parameters will not need transformation, but path and point params do. diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index 5d67ed016..a8d34a233 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -92,8 +92,6 @@ public: */ virtual void resetDefaults(SPItem * item); - virtual void setup_nodepath(Inkscape::NodePath::Path *np); - /// /todo: is this method really necessary? it causes UI inconsistensies... (johan) virtual void transform_multiply(Geom::Matrix const& postmul, bool set); diff --git a/src/live_effects/lpe-constructgrid.cpp b/src/live_effects/lpe-constructgrid.cpp index 144f4720d..d83529957 100644 --- a/src/live_effects/lpe-constructgrid.cpp +++ b/src/live_effects/lpe-constructgrid.cpp @@ -81,13 +81,6 @@ LPEConstructGrid::doEffect_path (std::vector<Geom::Path> const & path_in) } } -void -LPEConstructGrid::setup_nodepath(Inkscape::NodePath::Path *np) -{ - Effect::setup_nodepath(np); - sp_nodepath_make_straight_path(np); -} - } //namespace LivePathEffect } /* namespace Inkscape */ diff --git a/src/live_effects/lpe-constructgrid.h b/src/live_effects/lpe-constructgrid.h index 716960d32..c7e695794 100644 --- a/src/live_effects/lpe-constructgrid.h +++ b/src/live_effects/lpe-constructgrid.h @@ -27,8 +27,6 @@ public: virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> const & path_in); - virtual void setup_nodepath(Inkscape::NodePath::Path *np); - private: ScalarParam nr_x; ScalarParam nr_y; diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp index e211483c6..bd1ce7998 100644 --- a/src/live_effects/lpe-gears.cpp +++ b/src/live_effects/lpe-gears.cpp @@ -261,13 +261,6 @@ LPEGears::doEffect_path (std::vector<Geom::Path> const & path_in) return path_out; } -void -LPEGears::setup_nodepath(Inkscape::NodePath::Path *np) -{ - Effect::setup_nodepath(np); - sp_nodepath_make_straight_path(np); -} - } // namespace LivePathEffect } /* namespace Inkscape */ diff --git a/src/live_effects/lpe-gears.h b/src/live_effects/lpe-gears.h index 4c3a9938b..bd5e4c4f9 100644 --- a/src/live_effects/lpe-gears.h +++ b/src/live_effects/lpe-gears.h @@ -24,8 +24,6 @@ public: virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> const & path_in); - virtual void setup_nodepath(Inkscape::NodePath::Path *np); - private: ScalarParam teeth; ScalarParam phi; diff --git a/src/live_effects/lpe-spiro.cpp b/src/live_effects/lpe-spiro.cpp index 794fd980e..087b88351 100644 --- a/src/live_effects/lpe-spiro.cpp +++ b/src/live_effects/lpe-spiro.cpp @@ -116,14 +116,6 @@ LPESpiro::~LPESpiro() } void -LPESpiro::setup_nodepath(Inkscape::NodePath::Path *np) -{ - Effect::setup_nodepath(np); - sp_nodepath_show_handles(np, false); -// sp_nodepath_show_helperpath(np, false); -} - -void LPESpiro::doEffect(SPCurve * curve) { using Geom::X; diff --git a/src/live_effects/lpe-spiro.h b/src/live_effects/lpe-spiro.h index 7256665a2..4fcd9eaaa 100644 --- a/src/live_effects/lpe-spiro.h +++ b/src/live_effects/lpe-spiro.h @@ -24,7 +24,6 @@ public: virtual LPEPathFlashType pathFlashType() { return SUPPRESS_FLASH; } - virtual void setup_nodepath(Inkscape::NodePath::Path *np); virtual void doEffect(SPCurve * curve); private: diff --git a/src/live_effects/lpe-vonkoch.cpp b/src/live_effects/lpe-vonkoch.cpp index 7fd0ac0b4..b2a5d56fa 100644 --- a/src/live_effects/lpe-vonkoch.cpp +++ b/src/live_effects/lpe-vonkoch.cpp @@ -19,7 +19,7 @@ void VonKochPathParam::param_setup_nodepath(Inkscape::NodePath::Path *np) { PathParam::param_setup_nodepath(np); - sp_nodepath_make_straight_path(np); + //sp_nodepath_make_straight_path(np); } //FIXME: a path is used here instead of 2 points to work around path/point param incompatibility bug. @@ -27,12 +27,12 @@ void VonKochRefPathParam::param_setup_nodepath(Inkscape::NodePath::Path *np) { PathParam::param_setup_nodepath(np); - sp_nodepath_make_straight_path(np); + //sp_nodepath_make_straight_path(np); } bool VonKochRefPathParam::param_readSVGValue(const gchar * strvalue) { - std::vector<Geom::Path> old = _pathvector; + Geom::PathVector old = _pathvector; bool res = PathParam::param_readSVGValue(strvalue); if (res && _pathvector.size()==1 && _pathvector.front().size()==1){ return true; diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 93dfd2667..3a03de51c 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -40,6 +40,10 @@ #include "sp-text.h" #include "display/curve.h" +#include "ui/tool/node-tool.h" +#include "ui/tool/multi-path-manipulator.h" +#include "ui/tool/shape-record.h" + namespace Inkscape { @@ -195,16 +199,33 @@ PathParam::param_newWidget(Gtk::Tooltips * tooltips) void PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt) { - // TODO this whole method is broken! + using namespace Inkscape::UI; + + // TODO remove the tools_switch atrocity. + if (!tools_isactive(dt, TOOLS_NODES)) { + tools_switch(dt, TOOLS_NODES); + } + + InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context); + std::set<ShapeRecord> shapes; + ShapeRecord r; + + r.role = SHAPE_ROLE_LPE_PARAM; + r.edit_transform = Geom::identity(); // TODO this is almost certainly wrong + if (!href) { + r.item = reinterpret_cast<SPItem*>(param_effect->getLPEObj()); + r.lpe_key = param_key; + } else { + r.item = ref.getObject(); + } + shapes.insert(r); + nt->_multipath->setItems(shapes); } void -PathParam::param_setup_nodepath(Inkscape::NodePath::Path *np) +PathParam::param_setup_nodepath(Inkscape::NodePath::Path *) { - // TODO this too! - np->show_helperpath = true; - np->helperpath_rgba = 0x009000ff; - np->helperpath_width = 1.0; + // TODO this method should not exist at all! } void |
