diff --git a/libs/driver/src/VideoDriver.cpp b/libs/driver/src/VideoDriver.cpp index 2c67adf0f..91784d51e 100644 --- a/libs/driver/src/VideoDriver.cpp +++ b/libs/driver/src/VideoDriver.cpp @@ -27,7 +27,7 @@ VideoDriver::VideoDriver(VideoDriverLoaderInterface* CallBack) Position VideoDriver::GetMousePos() const { - return mouse_xy.pos; + return mouse_xy.pos * (int)dpiScale_; } /** diff --git a/libs/s25main/drivers/VideoDriverWrapper.cpp b/libs/s25main/drivers/VideoDriverWrapper.cpp index 7daa4801c..15d19d2e5 100644 --- a/libs/s25main/drivers/VideoDriverWrapper.cpp +++ b/libs/s25main/drivers/VideoDriverWrapper.cpp @@ -305,19 +305,19 @@ void VideoDriverWrapper::RenewViewport() if(!videodriver->IsOpenGL() || !renderer_) return; - const Extent renderSize = videodriver->GetRenderSize(); + const Extent renderSize = getGuiScale().viewToScreen(videodriver->GetRenderSize()); const VideoMode windowSize = videodriver->GetWindowSize(); // Set the viewport and scissor area to the entire window - glViewport(0, 0, windowSize.width, windowSize.height); - glScissor(0, 0, windowSize.width, windowSize.height); + glViewport(0, 0, renderSize.x, renderSize.y); + glScissor(0, 0, renderSize.x, renderSize.y); // Orthogonale Matrix erstellen glMatrixMode(GL_PROJECTION); glLoadIdentity(); // 0,0 should be top left corner - glOrtho(0, renderSize.x, renderSize.y, 0, -100, 100); + glOrtho(0, windowSize.width, windowSize.height, 0, -100, 100); glMatrixMode(GL_MODELVIEW); glLoadIdentity();