Closed peilingjiang closed 3 years ago
Hi @peilingjiang,
Thanks a lot for the PR! Sounds good. I'll be happy to merge it when it's ready.
I totally forgot about those additional styles not remembered by ctx.save/restore. Thanks for helping with this!
For minification, I was doing it by manually copy-pasting to https://javascript-minifier.com/, the reason being that it seems libs like uglify etc. either doesn't produce correct result or doesn't compress as much ¯\(ツ)/¯ I'm also ok with doing that myself after the PR, along with version bumping, which I guess would be appropriate too.
Feel free to let me know when the PR is ready, thanks!
Hi @LingDong-, I've minified the file and pushed this new commit. It should be ready to merge now. Could you handle the version bump and release? Thank you!
thanks a lot! I've bumped the version and published
push()
andpop()
ignores several important style definitions, includingnoStroke
ornoFill
, now as they are controlled directly in the library instead of byctx
. While the two functions only doctx.save()
andrestore()
.p5 web editor example - before, after
This PR is not ready to be merged yet, mainly because the result I got here is different from the one shown on the q5 demo page, and I don't know why. Also, I'm not sure if it's just a design choice. There are also several other things to do if there's actually a need for this PR -
Another minor change in the second commit is that I changed
$.frameCount++
to++$.frameCount
as the latter is slightly faster.