canvas.translate(width / 2, width / 2); canvas.rotate(45); canvas.drawRect(rect, paint); 它的变换顺序:平移 -> 旋转