From: jfbarraud Date: Mon, 3 Mar 2008 00:26:01 +0000 (+0000) Subject: changed vonkoch to use bbox of input object as reference. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8093a7318ad6a7e38a06a750205e4538cf188a95;p=inkscape.git changed vonkoch to use bbox of input object as reference. --- diff --git a/src/live_effects/lpe-vonkoch.cpp b/src/live_effects/lpe-vonkoch.cpp index 8a5326638..82ba1bf2d 100644 --- a/src/live_effects/lpe-vonkoch.cpp +++ b/src/live_effects/lpe-vonkoch.cpp @@ -6,6 +6,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include "live_effects/lpe-vonkoch.h" #include "sp-shape.h" #include "sp-item.h" @@ -58,16 +60,18 @@ LPEVonKoch::doEffect_path (std::vector & path_in) { using namespace Geom; std::vector generating_path = path_from_piecewise(generator,.01);//TODO what should that tolerance be? - Point p = generating_path[0].pointAt(0.001); - Point u = generating_path[0].pointAt(0.999)-generating_path[0].pointAt(0.001); - Matrix m0 = Matrix(u[X], u[Y],-u[Y], u[X], p[X], p[Y]); + Rect bbox = path_in[0].boundsExact(); + for(unsigned i=1; i < path_in.size(); i++){ + bbox.unionWith(path_in[i].boundsExact()); + } + Matrix m0 = Matrix(bbox[X].extent(),0,0,bbox[X].extent(), bbox.min()[X], bbox.min()[Y]); m0 = m0.inverse(); std::vector transforms; for (unsigned i=0; i > default_gen; // default_gen.concat(Piecewise >(D2(Linear(bndsX.min(),bndsX.max()),Linear((bndsY.min()+bndsY.max())/2))));