My logical size is 320x240. My window size is 640x480. SDL scales while rendering.
When using SDL_MouseButtonDown the returned values seem to adhere to the logical size as i can just use Event.Button.x or y and do my calculations on 320x240 perspective.
Now i noticed my official raspberry pi touchscreen was not producing mousebuttondown events so i started adding in Fingerdown events. The documents say the x and y values are normalized between 0 and 1 however i seem to be getting negative values when letterboxing occurs and i can not seem to calculate the correct positions compared to the logical 320x240 size / perspective. If i do not resize my window and no letterboxing occurs i can seemingly find out the correct values by multiplying event.tfinger.x * windowsize but this does not work if letterboxing occurs and the negative values arise. How can i get these calculation done or is not normal when letterboxing occurs i get negative values for event.tfinger.x /y ?
i mean this with letterboxing to keep aspect ratio when i resize my window