Skip to content
New issue

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

安卓自定义View进阶-Canvas之绘制图形 部分有误 #116

Open
xxssd-awsl opened this issue Aug 2, 2022 · 0 comments
Open

安卓自定义View进阶-Canvas之绘制图形 部分有误 #116

xxssd-awsl opened this issue Aug 2, 2022 · 0 comments

Comments

@xxssd-awsl
Copy link

关于对drawRoundRect的这部分描述:

其中灰色部分是我们所选定的矩形,而里面的圆角矩形则变成了一个椭圆,实际上在rx为宽度的一半,ry为高度的一半时,刚好是一个椭圆,通过上面我们分析的原理推算一下就能得到,而当rx大于宽度的一半,ry大于高度的一半时,实际上是无法计算出圆弧的,所以drawRoundRect对大于该数值的参数进行了限制(修正),凡是大于一半的参数均按照一半来处理。

我在使用的时候发现,大于一半的参数并不是按一半来处理的,是按等比缩放来处理的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant