Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

缩放(scale)我有一个疑问

Open
#83 2 comments 0 reactions 0 assignees View on GitHub

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

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);

1

  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);

2

我将蓝色矩形第一次移动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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GcsSloop/AndroidNote

All issues in GcsSloop/AndroidNote

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.