diff --git a/examples/splitview.c b/examples/splitview.c index 1ffcda67..ac0ffce5 100644 --- a/examples/splitview.c +++ b/examples/splitview.c @@ -383,6 +383,17 @@ static void windowRefreshFun(GLFWwindow* window) static void cursorPosFun(GLFWwindow* window, double x, double y) { + int wnd_width, wnd_height, fb_width, fb_height; + double scale; + + glfwGetWindowSize(window, &wnd_width, &wnd_height); + glfwGetFramebufferSize(window, &fb_width, &fb_height); + + scale = (double) fb_width / (double) wnd_width; + + x *= scale; + y *= scale; + // Depending on which view was selected, rotate around different axes switch (active_view) {