class BumpRectangular {
constructor(context,c ) {
this._context = context;
this._c = c;
this._point = 0;
this._line = 0;
}
areaStart() {
this._line = 0;
}
areaEnd() {
this._line = NaN;
}
lineStart() {
this._point = 0;
}
lineEnd() {
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
this._line = 1 - this._line;
}
point(x, y) {
if (this._point === 0) {
this._point = 1;
} else {
if (this._c===0){
var x1 = this._x0 +0.001 ;
this._context.moveTo(x1,this._y0);
this._context.lineTo(x1, y);
this._context.lineTo(x, y+0.001);
}else if(this._c<1){
this._context.moveTo(this._x0,this._y0);
this._context.bezierCurveTo(this._x0,y, this._x0+Math.abs(this._c*(this._x0-x)), y, x, y);
} else if (this._c==1){
this._context.moveTo(this._x0,this._y0);
this._context.lineTo(x, y);
}
}
this._x0 = x;
this._y0 = y;
}
}