Skip to content

Commit

Permalink
Update Mouse.cpp
Browse files Browse the repository at this point in the history
Use USER_DEFAULT_SCREEN_DPI define instead of 96 value.
  • Loading branch information
DJm00n authored Jan 8, 2025
1 parent 9d78cf1 commit 07237b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Src/Mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ class Mouse::Impl
explicit Impl(Mouse* owner) noexcept(false) :
mState{},
mOwner(owner),
mDPI(96.f),
mDPI(USER_DEFAULT_SCREEN_DPI),
mMode(MODE_ABSOLUTE),
mAutoReset(true),
mLastX(0),
Expand Down Expand Up @@ -906,8 +906,8 @@ class Mouse::Impl

const float dpi = s_mouse->mDPI;

s_mouse->mState.x = static_cast<int>(pos.X * dpi / 96.f + 0.5f);
s_mouse->mState.y = static_cast<int>(pos.Y * dpi / 96.f + 0.5f);
s_mouse->mState.x = static_cast<int>(pos.X * dpi / USER_DEFAULT_SCREEN_DPI + 0.5f);
s_mouse->mState.y = static_cast<int>(pos.Y * dpi / USER_DEFAULT_SCREEN_DPI + 0.5f);
}

return S_OK;
Expand Down Expand Up @@ -970,8 +970,8 @@ class Mouse::Impl

float dpi = s_mouse->mDPI;

s_mouse->mState.x = static_cast<int>(pos.X * dpi / 96.f + 0.5f);
s_mouse->mState.y = static_cast<int>(pos.Y * dpi / 96.f + 0.5f);
s_mouse->mState.x = static_cast<int>(pos.X * dpi / USER_DEFAULT_SCREEN_DPI + 0.5f);
s_mouse->mState.y = static_cast<int>(pos.Y * dpi / USER_DEFAULT_SCREEN_DPI + 0.5f);
}
}

Expand Down

0 comments on commit 07237b9

Please sign in to comment.