=== modified file 'src/live_effects/lpe-bendpath.cpp' --- src/live_effects/lpe-bendpath.cpp 2016-08-29 17:40:59 +0000 +++ src/live_effects/lpe-bendpath.cpp 2016-09-10 12:28:16 +0000 @@ -83,7 +83,6 @@ _provides_knotholder_entities = true; apply_to_clippath_and_mask = true; concatenate_before_pwd2 = true; - _prop_scale_store = prop_scale; } LPEBendPath::~LPEBendPath() @@ -97,9 +96,6 @@ // get the item bounding box original_bbox(lpeitem); original_height = boundingbox_Y.max() - boundingbox_Y.min(); - if(_prop_scale_store != prop_scale) { - prop_scale.param_set_value(_prop_scale_store); - } } Geom::Piecewise > @@ -140,9 +136,9 @@ } if ( scale_y_rel.get_value() ) { - y*=(scaling*_prop_scale_store); + y*=(scaling*prop_scale); } else { - if (_prop_scale_store != 1.0) y *= _prop_scale_store; + if (prop_scale != 1.0) y *= prop_scale; } Piecewise > output = compose(uskeleton,x) + y*compose(n,x); @@ -204,9 +200,9 @@ Geom::Point knot_pos = this->knot->pos * item->i2dt_affine().inverse(); Geom::Coord nearest_to_ray = ray.nearestTime(knot_pos); if(nearest_to_ray == 0){ - lpe->_prop_scale_store = -Geom::distance(s , ptA)/(lpe->original_height/2.0); + lpe->prop_scale.param_set_value(-Geom::distance(s , ptA)/(lpe->original_height/2.0)); } else { - lpe->_prop_scale_store = Geom::distance(s , ptA)/(lpe->original_height/2.0); + lpe->prop_scale.param_set_value(Geom::distance(s , ptA)/(lpe->original_height/2.0)); } sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true); @@ -227,7 +223,7 @@ ray.setPoints(ptA,(*cubic)[1]); } ray.setAngle(ray.angle() + Geom::rad_from_deg(90)); - Geom::Point result_point = Geom::Point::polar(ray.angle(), (lpe->original_height/2.0) * lpe->_prop_scale_store) + ptA; + Geom::Point result_point = Geom::Point::polar(ray.angle(), (lpe->original_height/2.0) * lpe->prop_scale) + ptA; bp_helper_path.clear(); Geom::Path hp(result_point); === modified file 'src/live_effects/lpe-bendpath.h' --- src/live_effects/lpe-bendpath.h 2016-08-29 17:40:59 +0000 +++ src/live_effects/lpe-bendpath.h 2016-09-10 12:28:16 +0000 @@ -58,7 +58,7 @@ BoolParam vertical_pattern; Geom::Piecewise > uskeleton; Geom::Piecewise > n; - double _prop_scale_store; + void on_pattern_pasted(); LPEBendPath(const LPEBendPath&); === modified file 'src/live_effects/lpe-patternalongpath.cpp' --- src/live_effects/lpe-patternalongpath.cpp 2016-09-09 12:16:07 +0000 +++ src/live_effects/lpe-patternalongpath.cpp 2016-09-10 12:28:16 +0000 @@ -95,7 +95,7 @@ prop_scale.param_set_increments(0.01, 0.10); _provides_knotholder_entities = true; - _prop_scale_store = prop_scale; + } LPEPatternAlongPath::~LPEPatternAlongPath() @@ -111,9 +111,6 @@ if (bbox) { original_height = (*bbox)[Geom::Y].max() - (*bbox)[Geom::Y].min(); } - if(_prop_scale_store != prop_scale) { - prop_scale.param_set_value(_prop_scale_store); - } } Geom::Piecewise > @@ -216,9 +213,9 @@ x*=scaling; } if ( scale_y_rel.get_value() ) { - y*=(scaling*_prop_scale_store); + y*=(scaling*prop_scale); } else { - if (_prop_scale_store != 1.0) y *= _prop_scale_store; + if (prop_scale != 1.0) y *= prop_scale; } x += toffset; @@ -256,7 +253,7 @@ Inkscape::Preferences *prefs = Inkscape::Preferences::get(); bool transform_stroke = prefs ? prefs->getBool("/options/transform/stroke", true) : true; if (transform_stroke && !scale_y_rel) { - prop_scale.param_set_value(_prop_scale_store * ((postmul.expansionX() + postmul.expansionY()) / 2)); + prop_scale.param_set_value(prop_scale * ((postmul.expansionX() + postmul.expansionY()) / 2)); } if (postmul.isTranslation()) { pattern.param_transform_multiply(postmul, set); @@ -302,9 +299,9 @@ Geom::Point knot_pos = this->knot->pos * item->i2dt_affine().inverse(); Geom::Coord nearest_to_ray = ray.nearestTime(knot_pos); if(nearest_to_ray == 0){ - lpe->_prop_scale_store = -Geom::distance(s , ptA)/(lpe->original_height/2.0); + lpe->prop_scale.param_set_value(-Geom::distance(s , ptA)/(lpe->original_height/2.0)); } else { - lpe->_prop_scale_store = Geom::distance(s , ptA)/(lpe->original_height/2.0); + lpe->prop_scale.param_set_value(Geom::distance(s , ptA)/(lpe->original_height/2.0)); } } @@ -328,7 +325,7 @@ ray.setPoints(ptA, (*cubic)[1]); } ray.setAngle(ray.angle() + Geom::rad_from_deg(90)); - Geom::Point result_point = Geom::Point::polar(ray.angle(), (lpe->original_height/2.0) * lpe->_prop_scale_store) + ptA; + Geom::Point result_point = Geom::Point::polar(ray.angle(), (lpe->original_height/2.0) * lpe->prop_scale) + ptA; pap_helper_path.clear(); Geom::Path hp(result_point); === modified file 'src/live_effects/lpe-patternalongpath.h' --- src/live_effects/lpe-patternalongpath.h 2016-08-29 17:40:59 +0000 +++ src/live_effects/lpe-patternalongpath.h 2016-09-10 12:28:16 +0000 @@ -61,7 +61,6 @@ BoolParam prop_units; BoolParam vertical_pattern; ScalarParam fuse_tolerance; - double _prop_scale_store; void on_pattern_pasted(); LPEPatternAlongPath(const LPEPatternAlongPath&); === modified file 'src/live_effects/lpe-powerstroke.cpp' --- src/live_effects/lpe-powerstroke.cpp 2016-06-16 20:29:40 +0000 +++ src/live_effects/lpe-powerstroke.cpp 2016-09-10 17:37:35 +0000 @@ -237,7 +237,7 @@ sp_repr_css_unset_property (css, "fill"); } - sp_repr_css_set_property(css, "fill-rule", "nonzero"); + sp_repr_css_set_property(css, "fill-rule", "nonzero"); sp_repr_css_set_property(css, "stroke", "none"); sp_desktop_apply_css_recursive(item, css, true); @@ -626,14 +626,14 @@ std::vector< double > rtsmin = roots (x - pwd2_in.domain().min()); std::vector< double > rtsmax = roots (x - pwd2_in.domain().max()); if ( !rtsmin.empty() && !rtsmax.empty() ) { - x = portion(x, rtsmin.at(0), rtsmax.at(0)); - y = portion(y, rtsmin.at(0), rtsmax.at(0)); + x = portion(x, rtsmin.at(0), rtsmax.at(0) + 0.00001); + y = portion(y, rtsmin.at(0), rtsmax.at(0) + 0.00001); } + LineJoinType jointype = static_cast(linejoin_type.get_value()); Piecewise > pwd2_out = compose(pwd2_in,x) + y*compose(n,x); Piecewise > mirrorpath = reverse(compose(pwd2_in,x) - y*compose(n,x)); - Geom::Path fixed_path = path_from_piecewise_fix_cusps( pwd2_out, y, jointype, miter_limit, LPE_CONVERSION_TOLERANCE); Geom::Path fixed_mirrorpath = path_from_piecewise_fix_cusps( mirrorpath, reverse(y), jointype, miter_limit, LPE_CONVERSION_TOLERANCE); if (pathv[0].closed()) { === modified file 'src/ui/tools/freehand-base.cpp' --- src/ui/tools/freehand-base.cpp 2016-08-29 17:40:59 +0000 +++ src/ui/tools/freehand-base.cpp 2016-09-10 12:38:45 +0000 @@ -226,19 +226,6 @@ Effect::createAndApply(PATTERN_ALONG_PATH, dc->desktop->doc(), item); Effect* lpe = SP_LPE_ITEM(item)->getCurrentLPE(); static_cast(lpe)->pattern.set_new_value(newpath,true); - - // write pattern along path parameters: - lpe->getRepr()->setAttribute("copytype", "single_stretched"); - lpe->getRepr()->setAttribute("fuse_tolerance", "0"); - lpe->getRepr()->setAttribute("is_visible", "true"); - lpe->getRepr()->setAttribute("normal_offset", "0"); - lpe->getRepr()->setAttribute("prop_scale", "1"); - lpe->getRepr()->setAttribute("prop_units", "false"); - lpe->getRepr()->setAttribute("scale_y_rel", "false"); - lpe->getRepr()->setAttribute("spacing", "0"); - lpe->getRepr()->setAttribute("tang_offset", "0"); - lpe->getRepr()->setAttribute("vertical_pattern", "false"); - } static void spdc_apply_powerstroke_shape(const std::vector & points, FreehandBase *dc, SPItem *item) @@ -330,9 +317,9 @@ bool shape_applied = false; SPCSSAttr *css_item = sp_css_attr_from_object(item, SP_STYLE_FLAG_ALWAYS); const char *cstroke = sp_repr_css_property(css_item, "stroke", "none"); - const char *stroke_width = sp_repr_css_property(css_item, "stroke-width", "0"); - double swidth; - sp_svg_number_read_d(stroke_width, &swidth); +// const char *stroke_width = sp_repr_css_property(css_item, "stroke-width", "0"); +// double swidth; +// sp_svg_number_read_d(stroke_width, &swidth); static SPItem *bend_item; #define SHAPE_LENGTH 10 @@ -354,8 +341,8 @@ { // "triangle in" std::vector points(1); - points[0] = Geom::Point(0., swidth/2); - points[0] *= i2anc_affine(static_cast(item->parent), NULL).inverse(); + points[0] = Geom::Point(0., SHAPE_LENGTH/2); + //points[0] *= i2anc_affine(static_cast(item->parent), NULL).inverse(); spdc_apply_powerstroke_shape(points, dc, item); shape_applied = true; @@ -366,8 +353,8 @@ // "triangle out" guint curve_length = curve->get_segment_count(); std::vector points(1); - points[0] = Geom::Point(0, swidth/2); - points[0] *= i2anc_affine(static_cast(item->parent), NULL).inverse(); + points[0] = Geom::Point(0, SHAPE_LENGTH/2); + //points[0] *= i2anc_affine(static_cast(item->parent), NULL).inverse(); points[0][Geom::X] = (double)curve_length; spdc_apply_powerstroke_shape(points, dc, item); @@ -805,16 +792,26 @@ if (!dc->white_item) { // Attach repr + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + shapeType shape_selected = (shapeType)prefs->getInt(tool_name(dc) + "/shape", 0); SPItem *item = SP_ITEM(desktop->currentLayer()->appendChildRepr(repr)); - - spdc_check_for_and_apply_waiting_LPE(dc, item, c); - if(previous_shape_type != BEND_CLIPBOARD){ - dc->selection->set(repr); + //Bend needs the transforms applied after, Other effects best before + if((previous_shape_type == BEND_CLIPBOARD && shape_selected == LAST_APPLIED) || + shape_selected == BEND_CLIPBOARD) + { + spdc_check_for_and_apply_waiting_LPE(dc, item, c); + previous_shape_type == BEND_CLIPBOARD; } Inkscape::GC::release(repr); item->transform = SP_ITEM(desktop->currentLayer())->i2doc_affine().inverse(); item->updateRepr(); item->doWriteTransform(item->getRepr(), item->transform, NULL, true); + if((previous_shape_type != BEND_CLIPBOARD || shape_selected != LAST_APPLIED) && + shape_selected != BEND_CLIPBOARD) + { + spdc_check_for_and_apply_waiting_LPE(dc, item, c); + dc->selection->set(repr); + } if(previous_shape_type == BEND_CLIPBOARD){ repr->parent()->removeChild(repr); }