Add support for building against Qt 6

This commit is contained in:
spycrab
2021-04-25 02:18:28 +02:00
committed by Shawn Hoffman
parent f8c603a2dd
commit 004e8a80b2
24 changed files with 545 additions and 84 deletions

View File

@ -502,8 +502,8 @@ void RenderWidget::PassEventToImGui(const QEvent* event)
// coordinates (as if the screen was standard dpi). We need to update the mouse position in
// native coordinates, as the UI (and game) is rendered at native resolution.
const float scale = devicePixelRatio();
ImGui::GetIO().MousePos.x = static_cast<const QMouseEvent*>(event)->x() * scale;
ImGui::GetIO().MousePos.y = static_cast<const QMouseEvent*>(event)->y() * scale;
ImGui::GetIO().MousePos.x = static_cast<const QMouseEvent*>(event)->pos().x() * scale;
ImGui::GetIO().MousePos.y = static_cast<const QMouseEvent*>(event)->pos().y() * scale;
}
break;