Code

fix LPE Sketch with new 2geom
authorjohanengelen <johanengelen@users.sourceforge.net>
Sat, 13 Dec 2008 20:28:32 +0000 (20:28 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sat, 13 Dec 2008 20:28:32 +0000 (20:28 +0000)
src/live_effects/lpe-sketch.cpp

index 1fe4ba52572bc40de2a16805df785a4c40d958b8..97bd8a49df709384b2c7d0f38729de8c8f6e1d2e 100644 (file)
@@ -151,13 +151,13 @@ LPESketch::computePerturbation (double s0, double s1){
     //compute howmany deg 3 sbasis to concat according to frequency.
     unsigned count = unsigned((s1-s0)/strokelength*tremble_frequency)+1; 
     for (unsigned i=0; i<count; i++){
-        D2<SBasis> perturb = D2<SBasis>();
+        D2<SBasis> perturb = D2<SBasis>(SBasis(2*count, Linear()), SBasis(2*count, Linear()));
         for (unsigned dim=0; dim<2; dim++){
             B[dim] = offset[dim] + 2*tremble_size-tremble_size.get_value();
-            perturb[dim].push_back(Linear(A[dim],B[dim]));
+            perturb[dim][2*i] = Linear(A[dim],B[dim]);
             dA[dim] = dA[dim]-B[dim]+A[dim];
             dB[dim] = 2*tremble_size-tremble_size.get_value();
-            perturb[dim].push_back(Linear(dA[dim],dB[dim]));
+            perturb[dim][2*i+1] = Linear(dA[dim],dB[dim]);
         }
         A = B;
         dA = B-A-dB;