I found a bug when drawing with rectangle and move upside
This bug found in method: onActionMove class CanvasView
You can fix this by:
from
case RECTANGLE :
path.reset();
path.addRect(this.startX, this.startY, x, y, Path.Direction.CCW);
break;
to
case RECTANGLE :
path.reset();
float sX = this.startX;
float sY = this.startY;
float eX = x;
float eY = y;
if(sX > eX){
sX = x;
eX = this.startX;
}
if(sY > eY){
sY = y;
eY = this.startY;
}
path.addRect(sX, sY, eX, eY, Path.Direction.CCW);
I found a bug when drawing with rectangle and move upside This bug found in method: onActionMove class CanvasView You can fix this by: from case RECTANGLE : path.reset(); path.addRect(this.startX, this.startY, x, y, Path.Direction.CCW); break;
to case RECTANGLE : path.reset(); float sX = this.startX; float sY = this.startY; float eX = x; float eY = y; if(sX > eX){ sX = x; eX = this.startX; } if(sY > eY){ sY = y; eY = this.startY; } path.addRect(sX, sY, eX, eY, Path.Direction.CCW);