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

textureData updated to fix flipping property for webgl #7305

Merged
merged 2 commits into from
Oct 13, 2024

Conversation

MuktiMishra
Copy link
Contributor

@MuktiMishra MuktiMishra commented Oct 11, 2024

Resolves #7300

Changes:

https://github.com/processing/p5.js/blob/75c0bfb49dc3202cda0ca847653aae008399a906/src/webgl/p5.Texture.js#L129C7-L132C53

  • New Check (this.src._ensureCanvas): The update introduces a check for this.src._ensureCanvas. If this method exists, it gets called. This ensures that a canvas is available for the source before proceeding.

  • New Assignment (this.src.canvas || this.src.elt): Instead of directly using this.src.elt, the code now assigns textureData from this.src.canvas (if available) or defaults to this.src.elt. This allows for the possibility of capturing the canvas representation of the source when necessary, when flipping has to be applied to video or images.

(I wasn't able to commit changes in my old pr and due to some glitch it isn't shown to me so I pulled a new request)

Copy link
Contributor

@perminder-17 perminder-17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work on this. Looks good to me ;)

For anyone interested in the discussion, we previously covered it in this GitHub PR: #7301, which is now closed.

Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making a PR for this!

@davepagurek davepagurek merged commit c377b53 into processing:main Oct 13, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

createCapture flipped property in WEBGL
3 participants