summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-09-29 01:56:43 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-09-29 01:56:43 +0000
commita82e6521b78fb89d040d9ae0b38c8e4691571920 (patch)
treeddf1af45b3fda5ec2ff22fe6180d598c14560a76 /src
parentThis push add suport to helper paths redraw to nodes, handles and knots. (diff)
downloadinkscape-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')
-rw-r--r--src/live_effects/parameter/powerstrokepointarray.cpp11
-rw-r--r--src/live_effects/parameter/powerstrokepointarray.h2
2 files changed, 8 insertions, 5 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)
diff --git a/src/live_effects/parameter/powerstrokepointarray.h b/src/live_effects/parameter/powerstrokepointarray.h
index 911bbc82d..70b22e27e 100644
--- a/src/live_effects/parameter/powerstrokepointarray.h
+++ b/src/live_effects/parameter/powerstrokepointarray.h
@@ -31,7 +31,7 @@ public:
virtual Gtk::Widget * param_newWidget();
- virtual void param_transform_multiply(Geom::Affine const& /*postmul*/, bool /*set*/);
+ virtual void param_transform_multiply(Geom::Affine const& postmul, bool /*set*/);
void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color);