-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Build base classes and visitors for custom shapes in p5.js 2.0 #7373
base: dev-2.0
Are you sure you want to change the base?
Conversation
…v-2.0 Updating my local repo before pushing to origin.
src/core/p5.Renderer.js
Outdated
@@ -49,6 +51,8 @@ class Renderer { | |||
this._clipping = false; | |||
this._clipInvert = false; | |||
this._curveTightness = 0; | |||
|
|||
this.currentShape = new Shape(); |
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.
@GregStanton it's not being used yet to actually draw shapes, but I've added a current shape to renderers. I've added a skeleton for a .reset()
method that can be called on it when beginShape()
is called to clear existing data, and I'm calling updateShapeVertexProperties()
in a few places where the shape's data would need to be updated based on the renderer's state.
@@ -696,6 +696,12 @@ export const BOTTOM = 'bottom'; | |||
* @final | |||
*/ | |||
export const BASELINE = 'alphabetic'; | |||
/** |
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.
@davepagurek Does this look okay? I remembered from the 2.0 RFC that the plan is to use Symbol
when the underlying value of a constant isn't needed. I'm guessing we just haven't gotten around to changing all the constants that fit that description?
Update: I added both PATH
and EMPTY_PATH
as Symbol values.
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.
I think so!
…ent, plus small changes
Addresses #6560
Changes:
Path2D
objects or vertices)Notes:
PR Checklist
Note: Since this is a draft PR, I'll update the checklist before submitting it for review. Inline documentation will be included, but I'll hold off on including unit tests covering the new behaviors, since those won't be testable until the next phase of work is completed.
npm run lint
passes