From: jfbarraud Date: Fri, 27 Mar 2009 08:49:13 +0000 (+0000) Subject: bug fix: close open paths on input. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b580e3a91737846ea251808a8a94f972b2bdfd6d;p=inkscape.git bug fix: close open paths on input. --- diff --git a/src/live_effects/lpe-rough-hatches.cpp b/src/live_effects/lpe-rough-hatches.cpp index 8b2c8aaf8..d75941b12 100644 --- a/src/live_effects/lpe-rough-hatches.cpp +++ b/src/live_effects/lpe-rough-hatches.cpp @@ -277,7 +277,7 @@ LPERoughHatches::LPERoughHatches(LivePathEffectObject *lpeobject) : front_thickness.param_set_range(0, NR_HUGE); back_thickness.param_set_range(0, NR_HUGE); - concatenate_before_pwd2 = true; + concatenate_before_pwd2 = false; show_orig_path = true; } @@ -294,6 +294,13 @@ LPERoughHatches::doEffect_pwd2 (Geom::Piecewise > const & Piecewise > result; Piecewise > transformed_pwd2_in = pwd2_in; + Point start = pwd2_in.segs.front().at0(); + Point end = pwd2_in.segs.back().at1(); + if (end != start ){ + transformed_pwd2_in.push_cut( transformed_pwd2_in.cuts.back() + 1 ); + D2 stitch( SBasis( 1, Linear(end[X],start[X]) ), SBasis( 1, Linear(end[Y],start[Y]) ) ); + transformed_pwd2_in.push_seg( stitch ); + } Point transformed_org = direction.getOrigin(); Piecewise tilter;//used to bend the hatches Matrix bend_mat;//used to bend the hatches @@ -302,7 +309,7 @@ LPERoughHatches::doEffect_pwd2 (Geom::Piecewise > const & Point bend_dir = -rot90(unit_vector(bender.getVector())); double bend_amount = L2(bender.getVector()); bend_mat = Matrix(-bend_dir[Y], bend_dir[X], bend_dir[X], bend_dir[Y],0,0); - transformed_pwd2_in = pwd2_in * bend_mat; + transformed_pwd2_in = transformed_pwd2_in * bend_mat; tilter = Piecewise(shift(Linear(-bend_amount),1)); OptRect bbox = bounds_exact( transformed_pwd2_in ); if (not(bbox)) return pwd2_in;