From 633fe680467e452fb6a6a5ae921f545167b0e80e Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Tue, 6 Apr 2021 01:01:59 +0200 Subject: [PATCH] fix: use ImGuiHelpers.MainViewport instead of ImGui builtin for W2S/S2W --- Dalamud/Game/Internal/Gui/GameGui.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dalamud/Game/Internal/Gui/GameGui.cs b/Dalamud/Game/Internal/Gui/GameGui.cs index b350e3d4d..a1c53c504 100644 --- a/Dalamud/Game/Internal/Gui/GameGui.cs +++ b/Dalamud/Game/Internal/Gui/GameGui.cs @@ -2,6 +2,7 @@ using System; using System.Runtime.InteropServices; using Dalamud.Game.Text.SeStringHandling.Payloads; using Dalamud.Hooking; +using Dalamud.Interface; using ImGuiNET; using Serilog; using SharpDX; @@ -290,7 +291,7 @@ namespace Dalamud.Game.Internal.Gui { // Read current ViewProjectionMatrix plus game window size var viewProjectionMatrix = new Matrix(); float width, height; - var windowPos = ImGui.GetMainViewport().Pos; + var windowPos = ImGuiHelpers.MainViewport.Pos; unsafe { var rawMatrix = (float*) (matrixSingleton + 0x1b4).ToPointer(); @@ -325,8 +326,8 @@ namespace Dalamud.Game.Internal.Gui { { // The game is only visible in the main viewport, so if the cursor is outside // of the game window, do not bother calculating anything - var windowPos = ImGui.GetMainViewport().Pos; - var windowSize = ImGui.GetMainViewport().Size; + var windowPos = ImGuiHelpers.MainViewport.Pos; + var windowSize = ImGuiHelpers.MainViewport.Size; if (screenPos.X < windowPos.X || screenPos.X > windowPos.X + windowSize.X || screenPos.Y < windowPos.Y || screenPos.Y > windowPos.Y + windowSize.Y)