From 31bb8269c26a781036448ed8f8cd93cc84fb2118 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 29 Nov 2009 16:33:18 +0100 Subject: First GSoC node tool commit to Bazaar (bzr r8846.1.1) --- src/live_effects/parameter/path.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 33e50155c..93dfd2667 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -195,23 +195,13 @@ PathParam::param_newWidget(Gtk::Tooltips * tooltips) void PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt) { - // If not already in nodecontext, goto it! - if (!tools_isactive(dt, TOOLS_NODES)) { - tools_switch(dt, TOOLS_NODES); - } - - ShapeEditor * shape_editor = dt->event_context->shape_editor; - if (!href) { - shape_editor->set_item_lpe_path_parameter(item, param_effect->getLPEObj(), param_key.c_str()); - } else { - // set referred item for editing - shape_editor->set_item(ref.getObject(), SH_NODEPATH); - } + // TODO this whole method is broken! } void PathParam::param_setup_nodepath(Inkscape::NodePath::Path *np) -{ +{ + // TODO this too! np->show_helperpath = true; np->helperpath_rgba = 0x009000ff; np->helperpath_width = 1.0; -- cgit v1.2.3 From e2b9f78d271e5fea988138d49020e704e72c83b1 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 8 Dec 2009 03:21:08 +0100 Subject: Fix LPEs and break mask transform undo (bzr r8846.2.3) --- src/live_effects/effect.cpp | 7 ------- src/live_effects/effect.h | 2 -- src/live_effects/lpe-constructgrid.cpp | 7 ------- src/live_effects/lpe-constructgrid.h | 2 -- src/live_effects/lpe-gears.cpp | 7 ------- src/live_effects/lpe-gears.h | 2 -- src/live_effects/lpe-spiro.cpp | 8 -------- src/live_effects/lpe-spiro.h | 1 - src/live_effects/lpe-vonkoch.cpp | 6 +++--- src/live_effects/parameter/path.cpp | 33 +++++++++++++++++++++++++++------ 10 files changed, 30 insertions(+), 45 deletions(-) (limited to 'src/live_effects') 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 @@ -664,13 +664,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) { 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 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 doEffect_path (std::vector 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 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 doEffect_path (std::vector 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 @@ -115,14 +115,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) { 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 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(dt->event_context); + std::set 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(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 -- cgit v1.2.3 From f542649162d6060f1f10513cc25e56c0f2736a13 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 24 Dec 2009 03:35:23 +0100 Subject: Remove remnants of old node tool (bzr r8846.2.6) --- src/live_effects/effect.cpp | 1 - src/live_effects/lpe-constructgrid.cpp | 2 -- src/live_effects/lpe-gears.cpp | 2 -- src/live_effects/lpe-lattice.cpp | 1 - src/live_effects/lpe-spiro.cpp | 1 - src/live_effects/lpe-vonkoch.cpp | 1 - src/live_effects/parameter/path.cpp | 2 -- 7 files changed, 10 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index dfa9fe6b2..d53048c76 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -28,7 +28,6 @@ #include "tools-switch.h" #include "message-stack.h" #include "desktop.h" -#include "nodepath.h" #include "knotholder.h" #include "live_effects/lpeobject.h" diff --git a/src/live_effects/lpe-constructgrid.cpp b/src/live_effects/lpe-constructgrid.cpp index d83529957..4725573d7 100644 --- a/src/live_effects/lpe-constructgrid.cpp +++ b/src/live_effects/lpe-constructgrid.cpp @@ -16,8 +16,6 @@ #include <2geom/path.h> #include <2geom/transforms.h> -#include "nodepath.h" - namespace Inkscape { namespace LivePathEffect { diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp index bd1ce7998..16eb19f44 100644 --- a/src/live_effects/lpe-gears.cpp +++ b/src/live_effects/lpe-gears.cpp @@ -14,8 +14,6 @@ #include <2geom/bezier-to-sbasis.h> #include <2geom/path.h> -#include "nodepath.h" - using std::vector; using namespace Geom; diff --git a/src/live_effects/lpe-lattice.cpp b/src/live_effects/lpe-lattice.cpp index 0beedb537..50ecdf04b 100644 --- a/src/live_effects/lpe-lattice.cpp +++ b/src/live_effects/lpe-lattice.cpp @@ -22,7 +22,6 @@ #include "sp-path.h" #include "display/curve.h" #include "svg/svg.h" -#include "nodepath.h" #include <2geom/sbasis.h> #include <2geom/sbasis-2d.h> diff --git a/src/live_effects/lpe-spiro.cpp b/src/live_effects/lpe-spiro.cpp index 087b88351..7c8262af6 100644 --- a/src/live_effects/lpe-spiro.cpp +++ b/src/live_effects/lpe-spiro.cpp @@ -7,7 +7,6 @@ #include "live_effects/lpe-spiro.h" #include "display/curve.h" -#include "nodepath.h" #include #include <2geom/pathvector.h> #include <2geom/matrix.h> diff --git a/src/live_effects/lpe-vonkoch.cpp b/src/live_effects/lpe-vonkoch.cpp index b2a5d56fa..85f8cde0c 100644 --- a/src/live_effects/lpe-vonkoch.cpp +++ b/src/live_effects/lpe-vonkoch.cpp @@ -8,7 +8,6 @@ #include #include "live_effects/lpe-vonkoch.h" -#include "nodepath.h" #include <2geom/transforms.h> //using std::vector; diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 3a03de51c..43f4b5725 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -28,10 +28,8 @@ // needed for on-canvas editting: #include "tools-switch.h" #include "shape-editor.h" -#include "node-context.h" #include "desktop-handles.h" #include "selection.h" -#include "nodepath.h" // clipboard support #include "ui/clipboard.h" // required for linking to other paths -- cgit v1.2.3 From 2ab01d69f9d427bdf3536e1508a465372cd040c6 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 14 Jan 2010 17:02:46 -0800 Subject: Warning cleanup. (bzr r8981) --- src/live_effects/parameter/path.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 43f4b5725..1ea9ac506 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -195,7 +195,7 @@ PathParam::param_newWidget(Gtk::Tooltips * tooltips) } void -PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt) +PathParam::param_editOncanvas(SPItem * /*item*/, SPDesktop * dt) { using namespace Inkscape::UI; @@ -222,7 +222,7 @@ PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt) void PathParam::param_setup_nodepath(Inkscape::NodePath::Path *) -{ +{ // TODO this method should not exist at all! } -- cgit v1.2.3 From 94b70606009fdafe61c32c171fff1dabb849f22e Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 17 Jan 2010 23:27:48 +0100 Subject: improve LPEExtrude: now connecting lines are also drawn at cusps (bzr r8995) --- src/live_effects/lpe-extrude.cpp | 48 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/lpe-extrude.cpp b/src/live_effects/lpe-extrude.cpp index af933eae6..093f7a05a 100644 --- a/src/live_effects/lpe-extrude.cpp +++ b/src/live_effects/lpe-extrude.cpp @@ -16,6 +16,7 @@ #include <2geom/path.h> #include <2geom/piecewise.h> #include <2geom/transforms.h> +#include namespace Inkscape { namespace LivePathEffect { @@ -35,6 +36,24 @@ LPEExtrude::~LPEExtrude() } +static bool are_colinear(Geom::Point a, Geom::Point b) { + return Geom::are_near(cross(a,b), 0., 0.5); +} + +// find cusps, this should be factored out later. +static std::vector find_cusps( Geom::Piecewise > const & pwd2_in ) { + using namespace Geom; + Piecewise > deriv = derivative(pwd2_in); + std::vector cusps; + // cusps are spots where the derivative jumps. + for (unsigned i = 1 ; i < deriv.size() ; ++i) { + if ( ! are_colinear(deriv[i-1].at1(), deriv[i].at0()) ) { + // there is a jump in the derivative, so add it to the cusps list + cusps.push_back(deriv.cuts[i]); + } + } + return cusps; +} Geom::Piecewise > LPEExtrude::doEffect_pwd2 (Geom::Piecewise > const & pwd2_in) @@ -48,6 +67,9 @@ LPEExtrude::doEffect_pwd2 (Geom::Piecewise > const & pwd2 switch( 1 ) { case 0: { + /* This one results in the following subpaths: the original, a displaced copy, and connector lines between the two + */ + Piecewise > pwd2_out = pwd2_in; // generate extrusion bottom: (just a copy of original path, displaced a bit) pwd2_out.concat( pwd2_in + extrude_vector.getVector() ); @@ -75,15 +97,33 @@ LPEExtrude::doEffect_pwd2 (Geom::Piecewise > const & pwd2 default: case 1: { + /* This one creates separate closed subpaths that correspond to the faces of the extruded shape. + * When the LPE is complete, one can convert the shape to a normal path, then break subpaths apart and start coloring them. + */ + Piecewise > pwd2_out; bool closed_path = are_near(pwd2_in.firstValue(), pwd2_in.lastValue()); // split input path in pieces between points where deriv == vector Piecewise > deriv = derivative(pwd2_in); std::vector rts = roots(dot(deriv, rot90(extrude_vector.getVector()))); + + std::vector cusps = find_cusps(pwd2_in); + + std::vector connector_pts; + if (rts.size() < 1) { + connector_pts = cusps; + } else if (cusps.size() < 1) { + connector_pts = rts; + } else { + connector_pts = rts; + connector_pts.insert(connector_pts.begin(), cusps.begin(), cusps.end()); + sort(connector_pts.begin(), connector_pts.end()); + } + double portion_t = 0.; - for (unsigned i = 0; i < rts.size() ; ++i) { - Piecewise > cut = portion(pwd2_in, portion_t, rts[i] ); - portion_t = rts[i]; + for (unsigned i = 0; i < connector_pts.size() ; ++i) { + Piecewise > cut = portion(pwd2_in, portion_t, connector_pts[i] ); + portion_t = connector_pts[i]; if (closed_path && i == 0) { // if the path is closed, skip the first cut and add it to the last cut later continue; @@ -96,7 +136,7 @@ LPEExtrude::doEffect_pwd2 (Geom::Piecewise > const & pwd2 } if (closed_path) { Piecewise > cut = portion(pwd2_in, portion_t, pwd2_in.domain().max() ); - cut.continuousConcat(portion(pwd2_in, pwd2_in.domain().min(), rts[0] )); + cut.continuousConcat(portion(pwd2_in, pwd2_in.domain().min(), connector_pts[0] )); Piecewise > part = cut; part.continuousConcat(connector + cut.lastValue()); part.continuousConcat(reverse(cut) + extrude_vector.getVector()); -- cgit v1.2.3 From 0283c65f9605dc7690e8b1f302a9754426a8b6c2 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Fri, 22 Jan 2010 11:54:17 +0100 Subject: Fix some of the LPE issues. (bzr r9013) --- src/live_effects/parameter/path.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 1ea9ac506..94540a255 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -195,7 +195,7 @@ PathParam::param_newWidget(Gtk::Tooltips * tooltips) } void -PathParam::param_editOncanvas(SPItem * /*item*/, SPDesktop * dt) +PathParam::param_editOncanvas(SPItem *item, SPDesktop * dt) { using namespace Inkscape::UI; @@ -209,7 +209,7 @@ PathParam::param_editOncanvas(SPItem * /*item*/, SPDesktop * dt) ShapeRecord r; r.role = SHAPE_ROLE_LPE_PARAM; - r.edit_transform = Geom::identity(); // TODO this is almost certainly wrong + r.edit_transform = sp_item_i2d_affine(item); // TODO is it right? if (!href) { r.item = reinterpret_cast(param_effect->getLPEObj()); r.lpe_key = param_key; -- cgit v1.2.3 From 8cf535c6993d50b80723fef8c2fd4a82d3b95aee Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 4 Feb 2010 22:33:19 +0100 Subject: improve LPE extrude such that cusps work for closed paths too (bzr r9051) --- src/live_effects/lpe-extrude.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/lpe-extrude.cpp b/src/live_effects/lpe-extrude.cpp index 093f7a05a..c861515aa 100644 --- a/src/live_effects/lpe-extrude.cpp +++ b/src/live_effects/lpe-extrude.cpp @@ -40,7 +40,8 @@ static bool are_colinear(Geom::Point a, Geom::Point b) { return Geom::are_near(cross(a,b), 0., 0.5); } -// find cusps, this should be factored out later. +// find cusps, except at start/end for closed paths. +// this should be factored out later. static std::vector find_cusps( Geom::Piecewise > const & pwd2_in ) { using namespace Geom; Piecewise > deriv = derivative(pwd2_in); @@ -102,13 +103,22 @@ LPEExtrude::doEffect_pwd2 (Geom::Piecewise > const & pwd2 */ Piecewise > pwd2_out; - bool closed_path = are_near(pwd2_in.firstValue(), pwd2_in.lastValue()); // split input path in pieces between points where deriv == vector Piecewise > deriv = derivative(pwd2_in); std::vector rts = roots(dot(deriv, rot90(extrude_vector.getVector()))); std::vector cusps = find_cusps(pwd2_in); + // see if we should treat the path as being closed. + bool closed_path = false; + if ( are_near(pwd2_in.firstValue(), pwd2_in.lastValue()) ) { + // the path is closed, however if there is a cusp at the closing point, we should treat it as being an open path. + if ( are_colinear(deriv.firstValue(), deriv.lastValue()) ) { + // there is no jump in the derivative, so treat path as being closed + closed_path = true; + } + } + std::vector connector_pts; if (rts.size() < 1) { connector_pts = cusps; -- cgit v1.2.3 From fcdf77adc6f2561600db805f202180ca8ef33e7b Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 14 Feb 2010 22:56:16 +0100 Subject: add widget controls for LPE VectorParam. Hide these controls for LPE Hatches. (bzr r9086.1.1) --- src/live_effects/lpe-rough-hatches.cpp | 4 ++++ src/live_effects/parameter/vector.cpp | 30 +++++++++++++----------------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/lpe-rough-hatches.cpp b/src/live_effects/lpe-rough-hatches.cpp index 228857ebf..f110aa743 100644 --- a/src/live_effects/lpe-rough-hatches.cpp +++ b/src/live_effects/lpe-rough-hatches.cpp @@ -279,6 +279,10 @@ LPERoughHatches::LPERoughHatches(LivePathEffectObject *lpeobject) : front_thickness.param_set_range(0, NR_HUGE); back_thickness.param_set_range(0, NR_HUGE); + // hide the widgets for direction and bender vectorparams + direction.widget_is_visible = false; + bender.widget_is_visible = false; + concatenate_before_pwd2 = false; show_orig_path = true; } diff --git a/src/live_effects/parameter/vector.cpp b/src/live_effects/parameter/vector.cpp index 35afe7f5d..5496b52f2 100644 --- a/src/live_effects/parameter/vector.cpp +++ b/src/live_effects/parameter/vector.cpp @@ -13,8 +13,9 @@ #include "svg/stringstream.h" #include -// needed for on-canvas editting: -class SPDesktop; +#include "ui/widget/registered-widget.h" +#include "live_effects/effect.h" +#include "desktop.h" namespace Inkscape { @@ -82,28 +83,23 @@ VectorParam::param_getSVGValue() const Gtk::Widget * VectorParam::param_newWidget(Gtk::Tooltips * /*tooltips*/) { -/* - Inkscape::UI::Widget::RegisteredTransformedPoint * pointwdg = Gtk::manage( - new Inkscape::UI::Widget::RegisteredTransformedPoint( param_label, - param_tooltip, - param_key, - *param_wr, - param_effect->getRepr(), - param_effect->getSPDoc() ) ); - // TODO: fix to get correct desktop (don't use SP_ACTIVE_DESKTOP) - SPDesktop *desktop = SP_ACTIVE_DESKTOP; - Geom::Matrix transf = desktop->doc2dt(); - pointwdg->setTransform(transf); - pointwdg->setValue( *this ); + Inkscape::UI::Widget::RegisteredVector * pointwdg = Gtk::manage( + new Inkscape::UI::Widget::RegisteredVector( param_label, + param_tooltip, + param_key, + *param_wr, + param_effect->getRepr(), + param_effect->getSPDoc() ) ); + pointwdg->setPolarCoords(); + pointwdg->setValue( vector, origin ); pointwdg->clearProgrammatically(); - pointwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change point parameter")); + pointwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change vector parameter")); Gtk::HBox * hbox = Gtk::manage( new Gtk::HBox() ); static_cast(hbox)->pack_start(*pointwdg, true, true); static_cast(hbox)->show_all_children(); return dynamic_cast (hbox); - */ return NULL; } void -- cgit v1.2.3 From 2e928d07bea3954f5fbca8f09de7f7567a39310c Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 14 Feb 2010 23:04:05 +0100 Subject: remove obsolete TODO comment that has been done already (bzr r9086.1.2) --- src/live_effects/effect.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/live_effects') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index d53048c76..f761a6a7c 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -673,7 +673,6 @@ Effect::transform_multiply(Geom::Matrix const& postmul, bool set) } } -// TODO: take _all_ parameters into account, not only PointParams bool Effect::providesKnotholder() { -- cgit v1.2.3 From 5d5831168342ab64916e2e8ab288ae26a774684f Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 18 Feb 2010 23:53:39 +0100 Subject: add Aaron and Michael as copyright holders of lpe-gears.cpp. Sorry I forgot them :-( (bzr r9098) --- src/live_effects/lpe-gears.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/live_effects') diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp index 16eb19f44..00f7ec193 100644 --- a/src/live_effects/lpe-gears.cpp +++ b/src/live_effects/lpe-gears.cpp @@ -2,6 +2,8 @@ /* * Copyright (C) Johan Engelen 2007 + * Copyright 2006 Michael G. Sloan + * Copyright 2006 Aaron Spike * * Released under GNU GPL, read the file 'COPYING' for more information */ -- cgit v1.2.3 From 847b4f57816ba691e471cf891beca6d263438f03 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 18 Mar 2010 23:21:16 -0700 Subject: Cleanup of SP_ACTIVE_DESKTOP to prepare clipboard code for reuse. (bzr r9209) --- src/live_effects/parameter/path.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 94540a255..d8d5b0a7c 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -412,7 +412,7 @@ void PathParam::on_paste_button_click() { Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get(); - Glib::ustring svgd = cm->getPathParameter(); + Glib::ustring svgd = cm->getPathParameter(SP_ACTIVE_DESKTOP); paste_param_path(svgd.data()); sp_document_done(param_effect->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Paste path parameter")); @@ -429,7 +429,7 @@ void PathParam::on_link_button_click() { Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get(); - Glib::ustring pathid = cm->getShapeOrTextObjectId(); + Glib::ustring pathid = cm->getShapeOrTextObjectId(SP_ACTIVE_DESKTOP); if (pathid == "") { return; -- cgit v1.2.3