Open mwcraig opened 6 years ago
Do you mean generalizing what you currently do for image widgets? ie, for each click, we would get the dimensions of the widget and return where the click was as a fraction of the total size?
I hadn't thought about it that way, but yes. I think the only question really is whether the size of the widget includes the border and padding (if any) or not. For images, those are excluded because they aren't part of the image....so I suppose for consistency's sake they should also be excluded for others too.
The original suggestion was made at the end here:
Also, I'd think normalize versions (between 0 and 1) would be useful.
@maartenbreddels -- were you thinking normalized versions of all of the coordinates returned?
For reference, the coordinates currently returned are:
These attributes are standard properties of HTML mouse events.
For widgets (like Label) for which there is no underlying array object these properties are not returned.
Normalized would be nice, since there may be a scale associated to the image that does not correspond to pixels. And you never know the try image size in the browser right?
Normalized would be nice
Just to be clear, you mean one normalized coordinate pair, or do you mean normalized versions of each of the x,y coordinates listed above? (screen, client, page, etc).
My leaning would be to provide normalized coordinates only for things like an image that have an intrinsic size).
And you never know the try image size in the browser right?
The only in-browser image size I really trust is the naturalWidth/naturalHeight. My understanding is that the <img width/height>
properties are completely meaningless...
Would need to decide whether these are normalized in the current view of the widget or normalized in the "natural" coordinates of the widget, if any.