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

Issue with GetPointer and Mozilla Firefox #4029

Closed
Tsunami2069 opened this issue Jun 22, 2017 · 12 comments · Fixed by #4061
Closed

Issue with GetPointer and Mozilla Firefox #4029

Tsunami2069 opened this issue Jun 22, 2017 · 12 comments · Fixed by #4061

Comments

@Tsunami2069
Copy link

Tsunami2069 commented Jun 22, 2017

Hello every1.

First of all, once again, congrats and kuddos on a great job. FabricJS is an amazing tool.
Now onwards to the issue at hand.

On a project of mine, I have a function that is responsible to detecting for intersections between objects and if the mouse, when the click is let go, was on top of the intersecting image.
For that, i have used the getPointer function of the canvas.

All was well until I recently tested my project in various browsers and discovered that they were working on all except Mozilla Firefox.
On Firefox, the getPointer function gives out a "event is undefined" (fabric.js:2168:9) error on the console and the image gets "glued" to the cursor.

Here's a simple fiddle that you can run on Firefox and confirm the issue:
https://jsfiddle.net/m4fs7okd/

My Firefox is up to date to the latest version (54.0).
The version of FabricJS is the most recent one (1.17.13).

Hope this helps...

@asturur
Copy link
Member

asturur commented Jun 22, 2017

so this thing is not new. let me check once again....

@Tsunami2069
Copy link
Author

Just a small update...
I didnt see anything related to this issue on the recent version's release notes but i decided to try it out anyways.
Unfortunately, no... Issue still remains with Firefox.

@asturur
Copy link
Member

asturur commented Jul 1, 2017

ok so i have to leave a comment in the code, since every time i check it and everytime i finish on the same mozilla link

https://developer.mozilla.org/en-US/docs/Web/API/Window/event

so window.event is a MS thing that chrome for some reason adopted.
When calling getPointer() the e parameter is mandatory.

https://jsfiddle.net/m4fs7okd/1/ this is the correct way of using getPointer in custom code.
You should be fine then.

I would say this is not a bug.

@asturur asturur closed this as completed Jul 1, 2017
@Tsunami2069
Copy link
Author

Errr sorry @asturur
Not sure if I understood your last post correctly or not but...

I tried the fiddle on Firefox and the problem persists.

Did I miss something or did u mean that there is no solution to this issue on Firefox?

Thank you.

@asturur
Copy link
Member

asturur commented Jul 3, 2017

my laziness made me answer too fast. sorry.
Give me half an hour and i ll post something better.

@Tsunami2069
Copy link
Author

Alright @asturur
I will wait.. thank you very much.

@asturur
Copy link
Member

asturur commented Jul 3, 2017

#4061 here it is!
now as first argument of the function, as before you get an object, but this time the event is there in the e property.

Use it to call canvas.getPointer(opt.e) and that should work.

@Tsunami2069
Copy link
Author

@asturur

Ok, i see the change...

Just to try and make sure i got this right (sorry, i'm not very knowledgeable with github), this involves a change to the modified event of the canvas (on the fabricjs code) to pass the event, so that we can use it on the getPointer, correct?

If so, when can I expect the new version to be available for download (been using the minified dist version so far)?

@asturur
Copy link
Member

asturur commented Jul 3, 2017

i ll try to push out 1.7.16 today.
Since today i m full on fabricjs, i ll see how many fixes on the 1.x branch i find and i ll push it out at the end of day.

thanks for insisting, i would have archived this easily.

@Tsunami2069
Copy link
Author

My pleasure, @asturur

I will wait for the new version.

Keep up the great work.
Thank you very much once more.

@asturur
Copy link
Member

asturur commented Jul 9, 2017

1.7.16 is out.

@Tsunami2069
Copy link
Author

@asturur

New version "installed" and change to the getPointer implemented.
Tested on Firefox and it is working again.

Thank you very much.
Keep up the great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants