diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-09-29 01:56:43 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-09-29 01:56:43 +0000 |
| commit | a82e6521b78fb89d040d9ae0b38c8e4691571920 (patch) | |
| tree | ddf1af45b3fda5ec2ff22fe6180d598c14560a76 /src/live_effects/parameter/powerstrokepointarray.cpp | |
| parent | This push add suport to helper paths redraw to nodes, handles and knots. (diff) | |
| download | inkscape-a82e6521b78fb89d040d9ae0b38c8e4691571920.tar.gz inkscape-a82e6521b78fb89d040d9ae0b38c8e4691571920.zip | |
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)
Diffstat (limited to 'src/live_effects/parameter/powerstrokepointarray.cpp')
| -rw-r--r-- | src/live_effects/parameter/powerstrokepointarray.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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<Geom::Point> result; + for (std::vector<Geom::Point>::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<Geom::D2<Geom::SBasis> > const & pwd2_in) |
