diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-11-02 00:19:42 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-11-02 00:19:42 +0000 |
| commit | c3cf3749afd1dddde094e4e1cf5e6c3285c03261 (patch) | |
| tree | 9735a7e7876dadd3ac976bd2e7349536767d198e | |
| parent | Fix a bug in perspective/envelope LPE, rendering points -handles- outside bou... (diff) | |
| download | inkscape-c3cf3749afd1dddde094e4e1cf5e6c3285c03261.tar.gz inkscape-c3cf3749afd1dddde094e4e1cf5e6c3285c03261.zip | |
Change calls to desktop with SP_ACTIVE_DESKTOP
(bzr r13656)
| -rw-r--r-- | src/live_effects/lpe-bspline.cpp | 9 | ||||
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.cpp | 8 | ||||
| -rw-r--r-- | src/live_effects/lpe-lattice2.cpp | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-perspective-envelope.cpp | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-roughen.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/lpe-simplify.cpp | 4 |
6 files changed, 14 insertions, 15 deletions
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp index e1ff49959..4f5ec2609 100644 --- a/src/live_effects/lpe-bspline.cpp +++ b/src/live_effects/lpe-bspline.cpp @@ -129,9 +129,8 @@ void LPEBSpline::doEffect(SPCurve *curve) double radiusHelperNodes = 6.0; SPDesktop *desktop = SP_ACTIVE_DESKTOP; if (desktop){ - radiusHelperNodes /= SP_ACTIVE_DESKTOP->current_zoom(); - SPNamedView *nv = sp_desktop_namedview(desktop); - radiusHelperNodes = Inkscape::Util::Quantity::convert(radiusHelperNodes, "px", nv->doc_units->abbr); + radiusHelperNodes /= desktop->current_zoom(); + radiusHelperNodes = Inkscape::Util::Quantity::convert(radiusHelperNodes, "px", desktop->namedview->doc_units->abbr); } for (Geom::PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) { @@ -408,7 +407,7 @@ void LPEBSpline::toWeight() void LPEBSpline::changeWeight(double weightValue) { - SPDesktop *desktop = inkscape_active_desktop(); + SPDesktop *desktop = SP_ACTIVE_DESKTOP; Inkscape::Selection *selection = sp_desktop_selection(desktop); GSList *items = (GSList *)selection->itemList(); SPItem *item = (SPItem *)g_slist_nth(items, 0)->data; @@ -450,7 +449,7 @@ void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weightValue) { using Geom::X; using Geom::Y; - SPDesktop *desktop = inkscape_active_desktop(); + SPDesktop *desktop = SP_ACTIVE_DESKTOP; if (INK_IS_NODE_TOOL(desktop->event_context)) { Inkscape::UI::Tools::NodeTool *nt = INK_NODE_TOOL(desktop->event_context); Inkscape::UI::ControlPointSelection::Set &selection = diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp index 8a8f68d80..a3964f553 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -212,7 +212,7 @@ void LPEFilletChamfer::updateFillet() { double power = 0; if (!flexible) { - Inkscape::Util::Unit const *doc_units = inkscape_active_desktop()->namedview->doc_units; + Inkscape::Util::Unit const *doc_units = SP_ACTIVE_DESKTOP->namedview->doc_units; power = Inkscape::Util::Quantity::convert(radius, unit.get_abbreviation(), doc_units->abbr) * -1; } else { power = radius; @@ -249,7 +249,7 @@ void LPEFilletChamfer::refreshKnots() { Piecewise<D2<SBasis> > const &pwd2 = fillet_chamfer_values.get_pwd2(); fillet_chamfer_values.recalculate_knots(pwd2); - SPDesktop *desktop = inkscape_active_desktop(); + SPDesktop *desktop = SP_ACTIVE_DESKTOP; if (tools_isactive(desktop, TOOLS_NODES)) { tools_switch(desktop, TOOLS_SELECT); tools_switch(desktop, TOOLS_NODES); @@ -272,7 +272,7 @@ bool LPEFilletChamfer::nodeIsSelected(Geom::Point nodePoint, std::vector<Geom::P void LPEFilletChamfer::doUpdateFillet(std::vector<Geom::Path> const& original_pathv, double power) { std::vector<Geom::Point> point; - SPDesktop *desktop = inkscape_active_desktop(); + SPDesktop *desktop = SP_ACTIVE_DESKTOP; if (INK_IS_NODE_TOOL(desktop->event_context)) { Inkscape::UI::Tools::NodeTool *nodeTool = INK_NODE_TOOL(desktop->event_context); Inkscape::UI::ControlPointSelection::Set &selection = nodeTool->_selected_nodes->allPoints(); @@ -334,7 +334,7 @@ void LPEFilletChamfer::doUpdateFillet(std::vector<Geom::Path> const& original_pa void LPEFilletChamfer::doChangeType(std::vector<Geom::Path> const& original_pathv, int type) { std::vector<Geom::Point> point; - SPDesktop *desktop = inkscape_active_desktop(); + SPDesktop *desktop = SP_ACTIVE_DESKTOP; if (INK_IS_NODE_TOOL(desktop->event_context)) { Inkscape::UI::Tools::NodeTool *nodeTool = INK_NODE_TOOL(desktop->event_context); diff --git a/src/live_effects/lpe-lattice2.cpp b/src/live_effects/lpe-lattice2.cpp index 8fadd79ed..e1cd91340 100644 --- a/src/live_effects/lpe-lattice2.cpp +++ b/src/live_effects/lpe-lattice2.cpp @@ -394,7 +394,7 @@ LPELattice2::resetGrid() grid_point32x33x34x35.param_set_and_write_default(); //todo:this hack is only to reposition the knots on reser grid button //Better update path effect in LPEITEM - SPDesktop * desktop = inkscape_active_desktop(); + SPDesktop * desktop = SP_ACTIVE_DESKTOP; tools_switch(desktop, TOOLS_SELECT); tools_switch(desktop, TOOLS_NODES); } diff --git a/src/live_effects/lpe-perspective-envelope.cpp b/src/live_effects/lpe-perspective-envelope.cpp index 0e620bc99..b5ef26e2f 100644 --- a/src/live_effects/lpe-perspective-envelope.cpp +++ b/src/live_effects/lpe-perspective-envelope.cpp @@ -337,7 +337,7 @@ LPEPerspectiveEnvelope::resetGrid() Down_Left_Point.param_set_and_write_default(); //todo:this hack is only to reposition the knots on reser grid button //Better update path effect in LPEITEM - SPDesktop * desktop = inkscape_active_desktop(); + SPDesktop * desktop = SP_ACTIVE_DESKTOP; tools_switch(desktop, TOOLS_SELECT); tools_switch(desktop, TOOLS_NODES); } diff --git a/src/live_effects/lpe-roughen.cpp b/src/live_effects/lpe-roughen.cpp index ae054fb8a..7ebd61c13 100644 --- a/src/live_effects/lpe-roughen.cpp +++ b/src/live_effects/lpe-roughen.cpp @@ -146,7 +146,7 @@ double LPERoughen::sign(double randNumber) Geom::Point LPERoughen::randomize() { - Inkscape::Util::Unit const *doc_units = inkscape_active_desktop()->namedview->doc_units; + Inkscape::Util::Unit const *doc_units = SP_ACTIVE_DESKTOP->namedview->doc_units; double displaceXParsed = Inkscape::Util::Quantity::convert( displaceX, unit.get_abbreviation(), doc_units->abbr); double displaceYParsed = Inkscape::Util::Quantity::convert( @@ -161,7 +161,7 @@ void LPERoughen::doEffect(SPCurve *curve) Geom::PathVector const original_pathv = pathv_to_linear_and_cubic_beziers(curve->get_pathvector()); curve->reset(); - Inkscape::Util::Unit const *doc_units = inkscape_active_desktop()->namedview->doc_units; + Inkscape::Util::Unit const *doc_units = SP_ACTIVE_DESKTOP->namedview->doc_units; for (Geom::PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) { if (path_it->empty()) diff --git a/src/live_effects/lpe-simplify.cpp b/src/live_effects/lpe-simplify.cpp index c191fbbe6..2b2efb1a9 100644 --- a/src/live_effects/lpe-simplify.cpp +++ b/src/live_effects/lpe-simplify.cpp @@ -157,8 +157,8 @@ LPESimplify::doEffect(SPCurve *curve) { Geom::PathVector outres = Geom::parse_svg_path(pathliv->svg_dump_path()); generateHelperPath(outres); curve->set_pathvector(outres); - if(SP_ACTIVE_DESKTOP && INK_IS_NODE_TOOL(SP_ACTIVE_DESKTOP->event_context)){ - SPDesktop* desktop = SP_ACTIVE_DESKTOP; + SPDesktop* desktop = SP_ACTIVE_DESKTOP; + if(desktop && INK_IS_NODE_TOOL(desktop->event_context)){ Inkscape::UI::Tools::NodeTool *nt = static_cast<Inkscape::UI::Tools::NodeTool*>(desktop->event_context); nt->update_helperpath(); } |
