-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mixing signatures for ScreenToX between int
and Point
#3460
Comments
I agree. Your preference? |
I think point makes most sense as that is the return type too.
Also eliminates any chance that someone gets the args the wrong way around
(I.e because there will only be 1).
But happy to be persuaded otherwise if there is any performance or elegance
factor others can see.
…On Wed, 8 May 2024, 21:30 Tig, ***@***.***> wrote:
I agree.
Your preference? Point or two int?
—
Reply to this email directly, view it on GitHub
<#3460 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHO3C5EX6XHD3IGDMG2Y2H3ZBKDO7AVCNFSM6AAAAABHNPKVQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBRGM3TENJVHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
It's pretty common in a lot of UI frameworks to expose both a coordinate pair (so Point, here) as well as the component coordinates, as ints, with the actual value being stored in the Point and the ints just retrieving that coordinate from the point for I'd suggest, to help with this sort of thing in general, and to force us to be consistent (plus for testing and other benefits), an Implementations in types declaring the interface should store just the Point as a private field and the properties do the above operations. We really need more interfaces, in general, for formality, consistency, testing, and consumer flexibility, without dependency on implementation. |
Oh also, a pretty important thing about immutable types as properties: The |
See #3461 |
Note, as part of ... we need to change |
Emphatic agree on that one. 👍 |
ScreenToContent
usesPoint
ScreenToViewport
usesint
,int
ScreenToFrame
usesint
,int
Is it possible to please standardize these? or is there a reason they are not consistent.
It makes debugging screen pointer issues difficult if you are trying to switch between the two methods to see which is more correct.
The text was updated successfully, but these errors were encountered: