parent
feac996b50
commit
9449e177f4
1 changed files with 3 additions and 0 deletions
|
@ -197,6 +197,9 @@ bool SdlWindow::warpMouseInWindow(int x, int y) {
|
||||||
if (hasMouseFocus()) {
|
if (hasMouseFocus()) {
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
if (_window) {
|
if (_window) {
|
||||||
|
float dpiScale = getSdlDpiScalingFactor();
|
||||||
|
x = (int)(x / dpiScale + 0.5f);
|
||||||
|
y = (int)(y / dpiScale + 0.5f);
|
||||||
SDL_WarpMouseInWindow(_window, x, y);
|
SDL_WarpMouseInWindow(_window, x, y);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue