From a82e6521b78fb89d040d9ae0b38c8e4691571920 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 29 Sep 2014 03:56:43 +0200 Subject: This push add a partial solution to scale powerstroke shapes without distorsion Currently best results are for fixed ratio scales, non fixed scale give a aproximation. (bzr r13341.1.228) --- src/live_effects/parameter/powerstrokepointarray.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/live_effects/parameter/powerstrokepointarray.cpp') diff --git a/src/live_effects/parameter/powerstrokepointarray.cpp b/src/live_effects/parameter/powerstrokepointarray.cpp index 427be8065..851b12ef8 100644 --- a/src/live_effects/parameter/powerstrokepointarray.cpp +++ b/src/live_effects/parameter/powerstrokepointarray.cpp @@ -68,13 +68,16 @@ PowerStrokePointArrayParam::param_newWidget() */ } - -void PowerStrokePointArrayParam::param_transform_multiply(Geom::Affine const& /*postmul*/, bool /*set*/) +void PowerStrokePointArrayParam::param_transform_multiply(Geom::Affine const& postmul, bool /*set*/) { -// param_set_and_write_new_value( (*this) * postmul ); + std::vector result; + for (std::vector::const_iterator point_it = _vector.begin(); point_it != _vector.end(); ++point_it) { + Geom::Coord A = (*point_it)[Geom::Y] * ((postmul.expansionX() + postmul.expansionY()) / 2); + result.push_back(Geom::Point((*point_it)[Geom::X], A)); + } + param_set_and_write_new_value(result); } - /** call this method to recalculate the controlpoints such that they stay at the same location relative to the new path. Useful after adding/deleting nodes to the path.*/ void PowerStrokePointArrayParam::recalculate_controlpoints_for_new_pwd2(Geom::Piecewise > const & pwd2_in) -- cgit v1.2.3