Shaper::clamp()
Description
Requires that shape() return between 0 and 1 only.

Shapers by default are not clamped in order to allow for interesting spacial animation. If you are using shaper functions for another domain where numbers outside of 0 to 1 don't make sense, then it's highly suggested to call the clamp() method after constructing a Shaper.
Example
import megamu.shapetween.*;

BezierShaper curve;

void setup(){  
  curve = new BezierShaper();
  curve.setInHandle( 0.5, -0.5 );
  curve.setOutHandle( 0.5, 1.5 );
}

void draw(){
  background(255);
  
  translate( width/6, height/6 );
  scale( 0.66 );
  
  fill(230);
  noStroke();
  rect(0,0,width,height);
  
  noFill();
  stroke(0);
  beginShape();
  for( float i=0; i<=1; i+= 0.05 )
    vertex( i*width, curve.shape( i )*height );
  endShape();
}

void mousePressed(){
  curve.clamp();
}

void mouseReleased(){
  curve.noClamp();
}
Syntax
clamp()
Related
noClamp()
shape()