Skip to content

Commit

Permalink
Windows D3D11: Fix touch input
Browse files Browse the repository at this point in the history
Introduced in: 16d2936
  • Loading branch information
xfangfang committed Oct 8, 2024
1 parent f5cf331 commit aeaa23a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/lib/platforms/glfw/glfw_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ static inline int getTouchState()

static void glfwTouchCallback(GLFWwindow* window, int touch, int action, double xpos, double ypos)
{
#if defined(BOREALIS_USE_D3D11)
float scale = 1.0f / Application::windowScale;
#else
double scaleFactor = Application::getPlatform()->getVideoContext()->getScaleFactor() / Application::windowScale;
#endif
touchState.fingerId = 0;
touchState.pressed = action != GLFW_RELEASE;
touchState.position.x = (float)(xpos * scaleFactor);
Expand Down

0 comments on commit aeaa23a

Please sign in to comment.