Thursday, December 12, 2024

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

Colin:

 

> To get the "real" size, use getOffsetWidth() and getOffsetHeight().

> With those values, *tell* the canvas how big you want it to be (via setCoordinateSpaceHeight/setCoordinateSpaceWidth)

 

Ahh, got it.

 

I called the get offset width and height in onAttachOrDetach and
then multiplied those values by a constant and called the setCoordinateSpace
methods.  Now it makes sense.

 

It is interesting the ClickEvent.getX() and getY() are giving me coordinates in the
screen space instead of the coordinate space, but that is an easy multiplication
to do.

 

Thank you,

 Neil

 

--

Neil Aggarwal, (972) 834-1565, http://www.propfinancing.com

We offer 30 year loans on single family houses!

No comments:

Post a Comment