The dimension we want to flip gets scaled by -1, reversing everything.
The dimension we don't want to flip gets scaled by 1, since multiplying something by one leaves it unchanged.
Try pressing V or H, also the Left and Right keys.
Because manipulations to the drawing context are cumulative, even though we seemingly haven't coded for the case of being flipped H and V at the same time, it works properly.
Now our sprite knows how to flip and rotate !
|