We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RectF rect1 = new RectF(0,-200,200,0); // 矩形区域 Paint paint1= new Paint(); paint1.setColor(Color.BLACK); Paint paint2= new Paint(); paint2.setColor(Color.BLUE); canvas.drawRect(rect1,paint1); canvas.scale(0.5f,0.5f,100,0); //画一个缩放前 矩形蓝 canvas.drawRect(rect1,paint2);
RectF rect1 = new RectF(0,-200,200,0); // 矩形区域 Paint paint1= new Paint(); paint1.setColor(Color.BLACK); Paint paint2= new Paint(); paint2.setColor(Color.BLUE); canvas.drawRect(rect1,paint1); canvas.scale(0.5f,0.5f,200,0); //画一个缩放前 矩形蓝 canvas.drawRect(rect1,paint2);
我将蓝色矩形第一次移动100,缩放中心移动100,位于黑色矩形底部中心。 然而第二次移动200,缩放中心应该在黑色矩形右边线上,目测只是移动了50。 那么移动距离究竟从哪里测量才对?
The text was updated successfully, but these errors were encountered:
不好意思,请忽视注释
Sorry, something went wrong.
你可想象下,是画布的坐标系进行了缩放,在(200,0)的位置做缩放,相当于缩放后的坐标原点在原来(100,0)的位置,而(200,0)的位置是缩放中心不变,两者之间的距离是200,位置就是图2的效果
而在(100,0)的位置做做缩放,相当于缩放后的坐标原点是原来的(50,0)
No branches or pull requests
我将蓝色矩形第一次移动100,缩放中心移动100,位于黑色矩形底部中心。
然而第二次移动200,缩放中心应该在黑色矩形右边线上,目测只是移动了50。
那么移动距离究竟从哪里测量才对?
The text was updated successfully, but these errors were encountered: