mirror of
https://github.com/love2d/love-android.git
synced 2026-08-18 03:34:18 +02:00
fixed mouse coordinates due to the love.window.getScale() change
This commit is contained in:
@@ -42,6 +42,7 @@ namespace sdl
|
||||
// we want them in pixel coordinates (may be different with high-DPI enabled.)
|
||||
static void windowToPixelCoords(int *x, int *y)
|
||||
{
|
||||
#ifndef LOVE_ANDROID
|
||||
double scale = 1.0;
|
||||
|
||||
window::Window *window = (window::Window *) Module::findInstance("love.window.");
|
||||
@@ -53,6 +54,7 @@ static void windowToPixelCoords(int *x, int *y)
|
||||
|
||||
if (y != nullptr)
|
||||
*y = int(double(*y) * scale);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user