From 0d0716e39d602dc39018bb9bf174cbd9bd717872 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 5 Apr 2021 12:53:12 -0400 Subject: [PATCH] fix screentoworld --- Dalamud/Game/Internal/Gui/GameGui.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dalamud/Game/Internal/Gui/GameGui.cs b/Dalamud/Game/Internal/Gui/GameGui.cs index 570e4b954..b350e3d4d 100644 --- a/Dalamud/Game/Internal/Gui/GameGui.cs +++ b/Dalamud/Game/Internal/Gui/GameGui.cs @@ -354,9 +354,10 @@ namespace Dalamud.Game.Internal.Gui { viewProjectionMatrix.Invert(); + var localScreenPos = new Vector2(screenPos.X - windowPos.X, screenPos.Y - windowPos.Y); var screenPos3D = new Vector3 { - X = screenPos.X / width * 2.0f - 1.0f, - Y = -(screenPos.Y / height * 2.0f - 1.0f), + X = localScreenPos.X / width * 2.0f - 1.0f, + Y = -(localScreenPos.Y / height * 2.0f - 1.0f), Z = 0 };