View Single Post
Old 01-09-2020, 02:35 PM   #889
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,221
Default

Quote:
Originally Posted by Sexan View Post
My brain is little stuck ATM what am I supposed to do? Subtract track top and bot with the height of the window?

EDIT:
Figured I need to reverse the track bottom
Code:
tr_b = tr_t - tr_h
right now everything is "fine" tracks are exactly on same pixels as the mouse is, coordinates now match. But where is the problem? What API expects "normal" in this case "inverted" coordinates? I guess mouse also needs to be inverted?

EDIT:
I really hope there is some simple solution to this, because I've modified a lot of calculating code and inverted lots of things to many functions to get right coordinates but still got nowhere
The method in the link that nofish posted is usually the best solution, and requires no arithmetic or different code for macOS:

* Some functions use or return *screen* coordinates, such as GetMousePosition, JS_Window_FromPoint, GetTrackFromPoint and GetItemFromPoint. These coordinates differ between Windows/Linux and macOS.

* Others use *client* coordinates, such as the LICE drawing functions, or GetMediaTrackInfo_Value(track, "I_TCPY"). These are the same between Windows /Linux and macOS.

I suggest that you only use screen coordinates when getting the mouse position and the track under the mouse. Then convert to client coordinates to do all the rest.
juliansader is online now   Reply With Quote