X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Flive_effects%2Flpe-skeletalstrokes.cpp;h=459b01861971b406a67b607aaebf5a80c6bb6737;hb=fac3eb9aebddbdb591b931d4c42a1a7d10f51a1c;hp=162dfe8a460f2b61b42aa7b9424b2151f0f938b7;hpb=042c507a35535b60939cac3b1bc6c1ec719ab2b8;p=inkscape.git diff --git a/src/live_effects/lpe-skeletalstrokes.cpp b/src/live_effects/lpe-skeletalstrokes.cpp index 162dfe8a4..459b01861 100644 --- a/src/live_effects/lpe-skeletalstrokes.cpp +++ b/src/live_effects/lpe-skeletalstrokes.cpp @@ -58,11 +58,15 @@ static const Util::EnumDataConverter SkelCopyTypeConverter(SkelCop LPESkeletalStrokes::LPESkeletalStrokes(LivePathEffectObject *lpeobject) : Effect(lpeobject), - pattern(_("Pattern"), _("Path to put along path"), "pattern", &wr, this, "M0,0 L1,1"), - copytype(_("Copytype"), _("How to shape the pattern path along the path"), "copytype", SkelCopyTypeConverter, &wr, this, SSCT_SINGLE_STRETCHED) + pattern(_("Pattern"), _("Path to put along path"), "pattern", &wr, this, "M0,0 L1,0"), + copytype(_("Copytype"), _("How to shape the pattern path along the path"), "copytype", SkelCopyTypeConverter, &wr, this, SSCT_SINGLE_STRETCHED), + prop_scale(_("Scale ratio"), _("Ratio between scaling in the x and y direction of the original path"), "prop_scale", &wr, this, 1), + scale_y(_("Scale pattern y"), _("Scale the height of the pattern path with its length"), "scale_stroke_y", &wr, this, false) { registerParameter( dynamic_cast(&pattern) ); registerParameter( dynamic_cast(©type) ); + registerParameter( dynamic_cast(&prop_scale) ); + registerParameter( dynamic_cast(&scale_y) ); } LPESkeletalStrokes::~LPESkeletalStrokes() @@ -76,8 +80,7 @@ LPESkeletalStrokes::doEffect (Geom::Piecewise > & pwd2_in { using namespace Geom; -/* LOTS OF CODE COPIED FROM 2geom/src/toys/path-along-path.cpp - * All credits should go to jfb and mgsloan of lib2geom development! */ +/* Much credit should go to jfb and mgsloan of lib2geom development for the code below! */ SkelCopyType type = copytype.get_value(); @@ -94,7 +97,6 @@ LPESkeletalStrokes::doEffect (Geom::Piecewise > & pwd2_in Interval pattBndsY = bounds_exact(y); y -= (pattBndsY.max()+pattBndsY.min())/2; - int nbCopies = int(uskeleton.cuts.back()/pattBnds.extent()); double scaling = 1; @@ -121,8 +123,12 @@ LPESkeletalStrokes::doEffect (Geom::Piecewise > & pwd2_in double pattWidth = pattBnds.extent() * scaling; - if (scaling != 1) + if (scaling != 1.0) { x*=scaling; + } + if ( scale_y.get_value() && (scaling*prop_scale != 1.0) ) { + y*=(scaling*prop_scale); + } double offs = 0; Piecewise > output;