-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Pass raw event information to brushes #5687
Conversation
FYI, failing tests seem to have nothing to do with this PR. |
So now i m going to sleep, just seen this now. |
Looking forward to hearing your ideas! |
It looks like i won't have the time to think on how i want to change the brushes. |
Sorry to hear that, but I'm okay with that decision of adding Would that be something around this line, for instance? |
e.g., adding |
no i meant something like: So that the more things we get to pass, we do not have to change much code. Ideally would be but that would be a breaking change, i m not sure we should do the day after the 3.0 release. I would also be ok to jump straight to 4.0 if the interface proove better. |
ok i have an idea: What do you think? |
Given that 1. Another way of thinking is, while the current implementation pass I'm okay with either way. |
i would like to have |
so it seems like you like this direction with a slight difference of
|
yes! mouseUp now takes nothing, but it will start to receive. Also pointer will soon get outdated if we support multi pointers, but that is another problem. Start to draft it, i will pull down the branch and check what information are already cached and what we can add to the info to give more options to devs. |
All clear! Thank you for your time. Please let me know when there's something I can do. |
@arcatdmz any chance you can move on with this PR? i would be happy to merge it. We need only to add that extra arguments to mouse events for brushes |
@asturur oooh, I finally see what you expect -- let me do that tonight. |
ok this is good! |
I'd like to continue working on adding pressure-sensitive brush implementation to fabric.js.
This simple PR would be the simplest modification toward that direction, adding raw event information as the last parameters of
BaseBrush.onMouse{Move|Down|Up}
methods. When combined with the{ enablePointerEvents: true }
option introduced in PR #5589, all brush subclasses can retrieve pressure information from the raw events.I'm open to discussions with @asturur and others to improve the brush API as noted in #5589 (comment).