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

[notify functions] mouse co-ordinates broken in Firefox #32

Open
CSchank opened this issue May 24, 2019 · 7 comments
Open

[notify functions] mouse co-ordinates broken in Firefox #32

CSchank opened this issue May 24, 2019 · 7 comments

Comments

@CSchank
Copy link
Member

CSchank commented May 24, 2019

Related to the way co-ordinates are calculated within a div after the introduction of widgets. Seems to work in 7.0.0 if I remember correctly. Thanks to @kapooa13 for finding this again. I had noticed it a while ago but forgot to file an issue.

@Erudition
Copy link

Ah, so is that what this is about?

update Msg: PointerMove (Infinity,-Infinity)

@Erudition
Copy link

Found this same issue in Chromium now too. Merging #2 is a great idea for preventing this Infinity nonsense, but the logic for calculating coordinates is still buggy...
Do I have to downgrade to 7.0.0?

@CSchank
Copy link
Member Author

CSchank commented Jan 16, 2022

Oh, is it really? This traditionally has been an issue in Firefox but we've stuck to Chromium-based browsers instead. Hmm.

@Erudition
Copy link

Downgrading to 7.0.0 seems to force going a major version back in elm/http, so I tried 7.1.0. No difference.

I suspect 7.0.0 would not have worked better, simply looking at the commits since then - can't see anything that would change the viewPort calculation. Only thing I notice is the width and height of the SVG is specified differently, but when manually adjusting that (via inspecting element) it does not fix it either.

I really wanted to try this library as a widget in my app, and spent a bunch of time wiring it all up, but I did not realize the project seems more or less abandoned. I definitely need the mouse features, and I would fork it if I knew how to fix it...

@Erudition
Copy link

Fascinating, I managed to find a way to get correct behavior - resizing the window. Triggering a resize message seems to get the pointer coordinates to come out correctly (or at least not infinity) in both Chromium and Firefox:
image

@CSchank
Copy link
Member Author

CSchank commented Jan 17, 2022

Oh! Did you use the initial commands provided by GraphicSVG? This is needed to poll for the screen size at the very beginning (if you don't do this you're likely getting a division by zero which leads to Infinity). Which kind of app are you using? I assume one of the more manual ones which doesn't do this for you.

@Erudition
Copy link

Erudition commented Jan 19, 2022

Oh jeez, yes I was creating the initial widget state in my model (in a dictionary no less) init function which Isn't meant to spit out commands... had to rewire everything to support page-specific init commands, but yes, now it works!! (In both browsers btw) Thank you!

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

2 participants