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

Draw brush strokes on lower-canvas? #4

Open
fariskas opened this issue Oct 19, 2017 · 7 comments
Open

Draw brush strokes on lower-canvas? #4

fariskas opened this issue Oct 19, 2017 · 7 comments

Comments

@fariskas
Copy link

I noticed that the brush strokes are drawn on the upper canvas. Thus making it impossible to layer with other items on the lower canvas.

The default fabric.js drawing brush draws on the lower canvas too.

Also, is it possible to select and move the strokes once they are drawn? Similar to how the default fabric.js brush works

@komagic
Copy link

komagic commented Sep 20, 2018

agree

@sops21
Copy link

sops21 commented Oct 19, 2018

Anyone figure this out?

@fariskas
Copy link
Author

not me. i just used the default drawing functions from fabric itself. while using textures to mimic the strokes (at least the crayon) on this addon

@sops21
Copy link

sops21 commented Oct 19, 2018

@fariskas Would you be willing to share your code for the crayon?

@fariskas
Copy link
Author

@sops21 sorry for the late reply. but here's what a gist of the code.
https://gist.github.com/fariskas/8a066a4adacf093e2bbe64034b41107d

@sops21
Copy link

sops21 commented Oct 21, 2018

@fariskas Thanks for sharing that!

One of the devs for fabric.js also posted this possible solution. Its kinda hacky, but it works. I'm going to test performance on it later today:

https://stackoverflow.com/questions/52885498/fabric-js-and-fabric-brush-cant-add-to-lower-canvas/

@fariskas
Copy link
Author

@sops21 cool! let me know how that goes. might have to relook into using this if its goes well

@github-staff github-staff deleted a comment from vokaplok Sep 17, 2024
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

No branches or pull requests

4 participants
@sops21 @komagic @fariskas and others