I find very little documentation on how to manipulate Path objects, in particular rotation.
I have a drawing application in which I am trying to enable the undo function. Each time the user's fingers touch the view until their finger is raised, their finger path will be saved as Path in the ArrayList. The cancellation method is as follows:
public void undo() {
int size = path_history.size();
if (size == 0)
return;
setupView();
for (int i=0; i<size-1; i++)
canvas.drawPath(path_history.get(i), paint);
path_history.remove(size-1);
invalidate();
}
, , , 90 ( , ). , , .
, :
Matrix m = new Matrix();
m.preRotate(90);
for (int i=0; i<size-1; i++)
path_history.get(i).transform(m);
, . , , , , . , ? , , , , .
!
.