[Update][Proposal] Improve Canvas Documentation#31153
[Update][Proposal] Improve Canvas Documentation#31153fluttergithubbot merged 3 commits intoflutter:mainfrom
Conversation
flar
left a comment
There was a problem hiding this comment.
There is another problem with the docs here in that the colors list says it is RGBA, but the correct format is ARGB. (which is the same format as Color.value)
One more issue which happens with the Canvas.drawVertices call that you also updated with the previous PR - it does not describe how the BlendMode parameter is used. We could say (in the documentation for drawVertices):
The [mode] parameter is used to control how the colors in the [vertices] are combined with the colors in the [paint]. If there are no colors specified in [vertices] then the [mode] has no effect. If there are colors in the [vertices], then the color taken from the [Shader] or [Color] in the [paint] is blended with the colors specified in the [vertices] using the [mode] parameter. For purposes of this blending, the colors from the [paint] are considered the source and the colors from the [vertices] are considered the destination.
lib/ui/painting.dart
Outdated
|
|
||
| /// Creates a set of vertex data for use with [Canvas.drawVertices], directly | ||
| /// using the encoding methods of [new Vertices]. | ||
| /// Note that this constructor uses a raw typed data list, |
lib/ui/painting.dart
Outdated
| /// Creates a set of vertex data for use with [Canvas.drawVertices], directly | ||
| /// using the encoding methods of [new Vertices]. | ||
| /// Note that this constructor uses a raw typed data list, | ||
| /// so it runs faster than Dart list version |
There was a problem hiding this comment.
faster than the [Vertices()] constructor
(Make sure it links correctly to the regular constructor)
lib/ui/painting.dart
Outdated
| /// using the encoding methods of [new Vertices]. | ||
| /// Note that this constructor uses a raw typed data list, | ||
| /// so it runs faster than Dart list version | ||
| /// because it doesn't require any conversion from Dart list. |
lib/ui/painting.dart
Outdated
| /// | ||
| /// If the [indices] list is provided, all values in the list must be | ||
| /// valid index values for [positions]. | ||
| /// |
There was a problem hiding this comment.
No extra line here, you are continuing to describe the same parameter as the previous paragrph.
lib/ui/painting.dart
Outdated
| /// The [textureCoordinates] list is interpreted as a list of repeated pairs | ||
| /// of x,y coordinates, and must be the same length of [positions] if it | ||
| /// is not null. | ||
| /// |
There was a problem hiding this comment.
No extra line here, both of these paragraphs describe the same parameter.
lib/ui/painting.dart
Outdated
| /// | ||
| /// The [positions] list is interpreted as a list of repeated pairs of x,y | ||
| /// coordinates. It must not be null. | ||
| /// The [positions] parameter is a list of triangular mesh vertices(xy). |
There was a problem hiding this comment.
These 2 sentences should be combined, such as
The [positions] parameter is a list of triangular mesh vertices and is interpreted as ...
There was a problem hiding this comment.
(And no need to specify xy twice as the rest of the first sentence also mentions that they are x,y coordinates.)
|
Hi @flar, Your comments were detailed and very helpful to me. |
flar
left a comment
There was a problem hiding this comment.
Looks Great! Thanks for doing this!
|
Thank you, too! |
|
The linter failure is real. There are couple of trailing whitespaces in this patch: Let's address these nits and land ASAP. Thanks. |
|
Thank you for always helping me out! |
|
I think I've seen that failure in the Linux Smoke Tests before. You might have to rebase this PR to the Top of Tree to fix it. |
eb7b676 to
9a845c4
Compare
|
Hi @flar, |
|
This pull request is not suitable for automatic merging in its current state.
|
This is an additional patch to the previously submitted patch.
Thanks to @flar for suggestions for making it better.
#30069
Also, this time, when I Fetch upstream from the browser (flutter / engine), I got an Actions error saying "GitHub token env var is not set.", But I haven't solved it.
I'm not sure what this is because I don't use Actions,
Please let me know if you have any problems with this patch.
If the patch is okay, ignore my problem with Actions.
Thank you.
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.