Thursday, December 12, 2024

Re: Not sure how to get the correct size of Canvas


The returned value should be the coordinates seen from the entire browser.
If you return an offset value from the absolute value of the Canvas it belongs to, you should get the correct value on the Canvas.
kazuohprc@gmail.com
2024年12月13日金曜日 2:07:53 UTC+9 Neil Aggarwal:
Hello everyone:

I am not sure how to get the correct size of a Canvas.

When I create the Canvas, it keeps telling me it is 300 x 150.
I get that size if I try to grab it in the onModuleLoad method
or from an attach event. They both keep telling me the Canvas
is 300 x 150.

But when I use a ClickEvent handler, the clicks are for an element
which is 900 x 450.

I tried extending the Canvas into a MyCanvas so I could add code
to the onload method, but its constructor is private so I can't override
it.

I am attaching my sample code.

You can see it running here:
https://dev.3dmathpuzzles.com/3dmp/play.html

Any guidance on this?

Thank you,
Neil

--
Neil Aggarwal, (972) 834-1565, http://www.propfinancing.com
We offer 30 year loans on single family houses!

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/13d9f7cd-6cc0-4c8a-b800-5dd218383bd3n%40googlegroups.com.

No comments:

Post a Comment