From ec559a5dfe4b9ab24a9e8a0799fa490b70c1f0a4 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 8 Aug 2015 12:28:31 +0200 Subject: minor changes (bzr r14272.1.10) --- src/live_effects/lpe-bendpath.cpp | 12 ++++++++---- src/live_effects/lpe-patternalongpath.cpp | 13 ++++++++----- 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp index d80f8e33a..5c20a7f9e 100644 --- a/src/live_effects/lpe-bendpath.cpp +++ b/src/live_effects/lpe-bendpath.cpp @@ -193,6 +193,7 @@ KnotHolderEntityWidthBendPath::knot_set(Geom::Point const &p, Geom::Point const& Geom::Path path_in = lpe->bend_path.get_pathvector().pathAt(Geom::PathVectorTime(0, 0, 0.0)); Geom::Point ptA = path_in.pointAt(Geom::PathTime(0, 0.0)); lpe->prop_scale.param_set_value(Geom::distance(s , ptA)/(lpe->original_height/2.0)); + sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true); } @@ -201,7 +202,6 @@ KnotHolderEntityWidthBendPath::knot_get() const { LPEBendPath *lpe = dynamic_cast (_effect); - bp_helper_path.clear(); Geom::Path path_in = lpe->bend_path.get_pathvector().pathAt(Geom::PathVectorTime(0, 0, 0.0)); Geom::Point ptA = path_in.pointAt(Geom::PathTime(0, 0.0)); Geom::Point B = path_in.pointAt(Geom::PathTime(1, 0.0)); @@ -213,9 +213,13 @@ KnotHolderEntityWidthBendPath::knot_get() const } Geom::Angle first_curve_angle = ray.transformed(Geom::Rotate(Geom::deg_to_rad(90))).angle(); Geom::Point result_point = Geom::Point::polar(first_curve_angle, (lpe->original_height * lpe->prop_scale)/2.0) + ptA; - Geom::Path hp_path(result_point); - hp_path.appendNew(ptA); - bp_helper_path.push_back(hp_path); + + bp_helper_path.clear(); + Geom::Path hp(result_point); + hp.appendNew(ptA); + bp_helper_path.push_back(hp); + hp.clear(); + return result_point; } } // namespace BeP diff --git a/src/live_effects/lpe-patternalongpath.cpp b/src/live_effects/lpe-patternalongpath.cpp index 72e1892ef..ed377e7f9 100644 --- a/src/live_effects/lpe-patternalongpath.cpp +++ b/src/live_effects/lpe-patternalongpath.cpp @@ -285,7 +285,7 @@ void KnotHolderEntityWidthPatternAlongPath::knot_set(Geom::Point const &p, Geom::Point const& /*origin*/, guint state) { LPEPatternAlongPath *lpe = dynamic_cast (_effect); - + Geom::Point const s = snap_knot_position(p, state); SPShape const *sp_shape = dynamic_cast(SP_LPE_ITEM(item)); if (sp_shape) { @@ -303,7 +303,6 @@ KnotHolderEntityWidthPatternAlongPath::knot_get() const SPShape const *sp_shape = dynamic_cast(SP_LPE_ITEM(item)); if (sp_shape) { - pap_helper_path.clear(); Geom::Path const *path_in = sp_shape->getCurveBeforeLPE()->first_path(); Geom::Point ptA = path_in->pointAt(Geom::PathTime(0, 0.0)); Geom::Point B = path_in->pointAt(Geom::PathTime(1, 0.0)); @@ -315,9 +314,13 @@ KnotHolderEntityWidthPatternAlongPath::knot_get() const } Geom::Angle first_curve_angle = ray.transformed(Geom::Rotate(Geom::deg_to_rad(90))).angle(); Geom::Point result_point = Geom::Point::polar(first_curve_angle, (lpe->original_height * lpe->prop_scale)/2.0) + ptA; - Geom::Path hp_path(result_point); - hp_path.appendNew(ptA); - pap_helper_path.push_back(hp_path); + + pap_helper_path.clear(); + Geom::Path hp(result_point); + hp.appendNew(ptA); + pap_helper_path.push_back(hp); + hp.clear(); + return result_point; } return Geom::Point(); -- cgit v1.2.3