Skip to content

Someone please explain ‘MouseEvent.OfX/OfY’ #3013

Answered by BDisp
tig asked this question in Q&A
Discussion options

You must be logged in to vote

There are to provide the mouse position offset from the grabbed view. It's calculated and processed on the Application mouse event. If the current mouse position is on another view than the grabbed view, the grabbed view receive the mouse event with view relative coordinate and the OfX/OfY gives the offset relative on the real mouse position. Thus the grabbed view know how much X/Y location it need to scroll. This give to the grabbed view more control about how it need to handled with the new position, to check if it's valid or not and take the right actions.

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@tig
Comment options

tig Nov 26, 2023
Maintainer Author

Answer selected by tig
Comment options

tig
Mar 3, 2024
Maintainer Author

You must be logged in to vote
3 replies
@BDisp
Comment options

@tig
Comment options

tig Mar 4, 2024
Maintainer Author

@BDisp
Comment options

Comment options

tig
Mar 4, 2024
Maintainer Author

You must be logged in to vote
1 reply
@BDisp
Comment options

Comment options

tig
Mar 4, 2024
Maintainer Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants