Ok but for a GWT Canvas there is no canvas.getBoundingClientRect() or
similar.

So this would mean I have to constantly update the mouseXY variables within
@UiHandler("canvas")
void onMove(MouseMoveEvent evt) {
   x = evt.getRelativeX()...
}

BUT wouldn't this add a big overhead in the long run if I constantly
rewrite the coordinates?
I could of course use some timer to update XY, but this would then again
result in inaccurate coordinates if the keypress comes in the wrong moment.


2013/4/3 Jens <jens.nehlme...@gmail.com>

> Missed the part that you want the mouse position in a canvas.
>
> Take a look at
> http://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/
>
>
> You could easily transfer this to GWT and on a key event use the current
> mouse position you have saved in your app by tracking the mouse movement on
> the canvas element.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to