缩放(scale)我有一个疑问
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- android, java
- Domain
- computer-graphics, mobile-dev
Research direction
Start with the two Android Canvas examples in the issue and read the documentation for Canvas.scale, especially its pivot parameters and coordinate transformations. Compare the results for pivot x=100 and x=200, then document the coordinate system and the expected movement shown by both snippets.
Written by the indexing model from the issue text.
Description
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。
那么移动距离究竟从哪里测量才对?
- Dominant language
- Java
- Stars
- 9.3k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GcsSloop/AndroidNote
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
GcsSloop/AndroidNote#116 ·
-
安卓 Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
GcsSloop/AndroidNote#115 ·
-
章节缺失:安卓自定义View进阶 Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
GcsSloop/AndroidNote#114 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 55/100
GcsSloop/AndroidNote#111 · 2 reactions ·
-
博客有几篇打不开了 Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
GcsSloop/AndroidNote#110 ·
All issues in GcsSloop/AndroidNote
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
elastic/gradle-plugins#157 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cryptomator/hub#497 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
johanhaleby/occurrent#1120 ·