我正在这样的缩放画布上绘制文字:
Rect bounds = new Rect();
paint.getTextBounds(fct.getText(), 0, fct.getText().length(), bounds);
float scaleX = postcard.getWidth() / fct.getContainerWidth();
float scaleY = postcard.getHeight() / fct.getContainerHeight();
float textXpos = fct.getPositionX();
float textYpos = fct.getPositionY();
float rotateX = textXpos + bounds.exactCenterX();
float rotateY = textYpos + bounds.exactCenterY();
canvas.save();
canvas.scale(scaleX, scaleY);
canvas.rotate(fct.getRotation(), rotateX, rotateY);
canvas.drawText(fct.getText(), textXpos, textYpos, paint);
canvas.restore();
绘制文本的X位置完全正确,但Y位置错误。
文本被绘制在预期位置之上。
那么如何正确绘制呢?