Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMouse.position's initial value is (0, 0) #91
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Jan 10, 2015
Contributor
That comes from this line: https://github.com/elm-lang/core/blob/master/src/Native/Mouse.js#L14
You would have to replace the Utils.Tuple2(0,0) in there by the current mouse position at program start. However, when that line of code is run, the "page" with respect to which you want the mouse position most likely doesn't even exist yet.
|
That comes from this line: https://github.com/elm-lang/core/blob/master/src/Native/Mouse.js#L14 You would have to replace the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Jan 10, 2015
Contributor
In other words, this issue is unlikely to get fixed unless the runtime (in particular the way the signal graph is built and initialized, and when the actual "graphics display" is created) were restructured somewhat considerably.
|
In other words, this issue is unlikely to get fixed unless the runtime (in particular the way the signal graph is built and initialized, and when the actual "graphics display" is created) were restructured somewhat considerably. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jan 10, 2015
Member
I don't think it is possible to ask any browser for the mouse position, so my understanding is that this is not possible. If you can find a way to synchronously detect the mouse position in JS, we can do this. If you cannot, we should close this issue.
|
I don't think it is possible to ask any browser for the mouse position, so my understanding is that this is not possible. If you can find a way to synchronously detect the mouse position in JS, we can do this. If you cannot, we should close this issue. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Aha, I see. That's a pity... |
thSoft
closed this
Jan 10, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Jan 10, 2015
Contributor
Oh, so it's even worse, there is nothing to replace the Utils.Tuple2(0,0) in the first place. Learned something.
|
Oh, so it's even worse, there is nothing to replace the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jan 10, 2015
Member
Yeah, I was surprised when I learned this as well. I'd like to do it nicer, but given that it has been impossible for 20+ years, I don't have tons of hope :P
|
Yeah, I was surprised when I learned this as well. I'd like to do it nicer, but given that it has been impossible for 20+ years, I don't have tons of hope :P |
thSoft commentedJan 10, 2015
The initial value of Mouse.position is (0, 0) regardless of the actual position of the mouse until it is moved. Example to reproduce: http://share-elm.com/sprout/54b129a6e4b05f9c59b24f3a
Elm version: 0.14.1