diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-17 22:20:39 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-17 22:20:39 +1000 |
commit | 34bb0b54222c1c0f3450c56e76f89f192d77374b (patch) | |
tree | 09e119625d066d16e3a81a8f6c0c424c4159f058 /source/windowing/StarGuiContext.cpp | |
parent | 848b11399f2e34d7f1e0523e214287bfdcc5816c (diff) |
Initial voice HUD indicator setup
Diffstat (limited to 'source/windowing/StarGuiContext.cpp')
-rw-r--r-- | source/windowing/StarGuiContext.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/windowing/StarGuiContext.cpp b/source/windowing/StarGuiContext.cpp index 2d649c5..73713d1 100644 --- a/source/windowing/StarGuiContext.cpp +++ b/source/windowing/StarGuiContext.cpp @@ -98,9 +98,9 @@ void GuiContext::setInterfaceScale(int interfaceScale) { m_interfaceScale = interfaceScale; } -Maybe<Vec2I> GuiContext::mousePosition(InputEvent const& event) const { - auto getInterfacePosition = [this](Vec2I pos) { - return Vec2I(pos) / interfaceScale(); +Maybe<Vec2I> GuiContext::mousePosition(InputEvent const& event, int pixelRatio) const { + auto getInterfacePosition = [pixelRatio](Vec2I pos) { + return Vec2I(pos) / pixelRatio; }; if (auto mouseMoveEvent = event.ptr<MouseMoveEvent>()) @@ -115,6 +115,10 @@ Maybe<Vec2I> GuiContext::mousePosition(InputEvent const& event) const { return {}; } +Maybe<Vec2I> GuiContext::mousePosition(InputEvent const& event) const { + return mousePosition(event, interfaceScale()); +} + Set<InterfaceAction> GuiContext::actions(InputEvent const& event) const { return m_keyBindings.actions(event); } |