diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-09-14 22:50:14 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-09-14 22:50:14 +0000 |
| commit | 02fd63b2bced87a592e98848e7fd922e8966151f (patch) | |
| tree | 4785cfdaa358a1953bec3bfb678fa007cbf6f590 /src/live_effects/lpe-skeletalstrokes.cpp | |
| parent | Clean up code a bit. (diff) | |
| download | inkscape-02fd63b2bced87a592e98848e7fd922e8966151f.tar.gz inkscape-02fd63b2bced87a592e98848e7fd922e8966151f.zip | |
change Y-scaling for curve stiching and path-along-path. add warning message when path effect errors due to 2geom exception.
(bzr r3748)
Diffstat (limited to 'src/live_effects/lpe-skeletalstrokes.cpp')
| -rw-r--r-- | src/live_effects/lpe-skeletalstrokes.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/live_effects/lpe-skeletalstrokes.cpp b/src/live_effects/lpe-skeletalstrokes.cpp index 4152a920e..8521a2cee 100644 --- a/src/live_effects/lpe-skeletalstrokes.cpp +++ b/src/live_effects/lpe-skeletalstrokes.cpp @@ -12,6 +12,7 @@ #include <libnr/n-art-bpath.h>
#include "live_effects/n-art-bpath-2geom.h"
#include "svg/svg.h"
+#include "ui/widget/scalar.h"
#include <2geom/sbasis.h>
#include <2geom/sbasis-geometric.h>
@@ -58,15 +59,18 @@ static const Util::EnumDataConverter<SkelCopyType> SkelCopyTypeConverter(SkelCop LPESkeletalStrokes::LPESkeletalStrokes(LivePathEffectObject *lpeobject) :
Effect(lpeobject),
- pattern(_("Pattern source:"), _("Path to put along the skeleton path"), "pattern", &wr, this, "M0,0 L1,0"),
- copytype(_("Pattern copies:"), _("How many pattern copies to place along the skeleton path"), "copytype", SkelCopyTypeConverter, &wr, this, SSCT_SINGLE_STRETCHED),
- prop_scale(_("Scale ratio:"), _("Ratio between scaling the length and width of the pattern"), "prop_scale", &wr, this, 1), - scale_y(_("Scale pattern width"), _("Scale the width of the pattern (perpendicular to skeleton) with its length"), "scale_stroke_y", &wr, this, false)
+ pattern(_("Pattern source"), _("Path to put along the skeleton path"), "pattern", &wr, this, "M0,0 L1,0"),
+ copytype(_("Pattern copies"), _("How many pattern copies to place along the skeleton path"), "copytype", SkelCopyTypeConverter, &wr, this, SSCT_SINGLE_STRETCHED),
+ prop_scale(_("Y scaling"), _("Scaling of the width of the pattern"), "prop_scale", &wr, this, 1),
+ scale_y_rel(_("Scale Y relative to X"), _("Scale the width of the pattern relative to its length"), "scale_y_rel", &wr, this, false)
{
registerParameter( dynamic_cast<Parameter *>(&pattern) );
registerParameter( dynamic_cast<Parameter *>(©type) );
registerParameter( dynamic_cast<Parameter *>(&prop_scale) );
- registerParameter( dynamic_cast<Parameter *>(&scale_y) );
+ registerParameter( dynamic_cast<Parameter *>(&scale_y_rel) );
+
+ prop_scale.param_set_digits(3);
+ prop_scale.param_set_increments(0.01, 0.10);
}
LPESkeletalStrokes::~LPESkeletalStrokes()
@@ -126,8 +130,10 @@ LPESkeletalStrokes::doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in if (scaling != 1.0) {
x*=scaling;
}
- if ( scale_y.get_value() && (scaling*prop_scale != 1.0) ) {
+ if ( scale_y_rel.get_value() ) {
y*=(scaling*prop_scale);
+ } else {
+ if (prop_scale != 1.0) y *= prop_scale;
}
double offs = 0;
|
