-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
feat: The build (ShapeBuilder) method should report its success #11283
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
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 4624e6a:
|
ooh, yes - i like the idea here! |
would you be able to add some tests around this please? |
Added tests, finalized the code and fixed the problem with GpuContext.isBatchable when the 'batch' mode is set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work @midiusRed !
ShapeBuilder includes 2 methods: build, triangulate. Using the buildRectangle example, we see that there is a check !(width >= 0 && height >= 0). In this case, the points are not added, and then triangulate (which adds undefined) is performed and BatchableGraphics is created for the discarded primitive. I suggest an option in which build decides what to do with the primitive, and if it is incorrect, false will be returned. In this case, we will not add BatchableGraphics and run this primitive in pipe.