Render GUI correctly on retina screens (#834)

This commit is contained in:
Emil Axelsson
2019-04-27 15:45:36 +02:00
committed by Alexander Bock
parent 1d50a88fc0
commit 6a6db9aa78
3 changed files with 18 additions and 7 deletions
+5 -2
View File
@@ -26,6 +26,8 @@
#include <modules/webbrowser/include/browserinstance.h>
#include <openspace/engine/globalscallbacks.h>
#include <openspace/engine/globals.h>
#include <openspace/engine/windowdelegate.h>
#include <ghoul/logging/logmanager.h>
#include <fmt/format.h>
@@ -268,8 +270,9 @@ bool EventHandler::isDoubleClick(const MouseButtonState& button) const {
}
bool EventHandler::mousePositionCallback(double x, double y) {
_mousePosition.x = floor(static_cast<float>(x));
_mousePosition.y = floor(static_cast<float>(y));
const glm::vec2 dpiScaling = global::windowDelegate.dpiScaling();
_mousePosition.x = floor(static_cast<float>(x) * dpiScaling.x);
_mousePosition.y = floor(static_cast<float>(y) * dpiScaling.y);
_browserInstance->sendMouseMoveEvent(mouseEvent());
// Let the mouse event trickle on
return false;