mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-21 07:17:45 +01:00
fix: use ImGuiHelpers.MainViewport instead of ImGui builtin for W2S/S2W
This commit is contained in:
parent
1677cb084b
commit
633fe68046
1 changed files with 4 additions and 3 deletions
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||||
using Dalamud.Hooking;
|
using Dalamud.Hooking;
|
||||||
|
using Dalamud.Interface;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using SharpDX;
|
using SharpDX;
|
||||||
|
|
@ -290,7 +291,7 @@ namespace Dalamud.Game.Internal.Gui {
|
||||||
// Read current ViewProjectionMatrix plus game window size
|
// Read current ViewProjectionMatrix plus game window size
|
||||||
var viewProjectionMatrix = new Matrix();
|
var viewProjectionMatrix = new Matrix();
|
||||||
float width, height;
|
float width, height;
|
||||||
var windowPos = ImGui.GetMainViewport().Pos;
|
var windowPos = ImGuiHelpers.MainViewport.Pos;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
var rawMatrix = (float*) (matrixSingleton + 0x1b4).ToPointer();
|
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
|
// The game is only visible in the main viewport, so if the cursor is outside
|
||||||
// of the game window, do not bother calculating anything
|
// of the game window, do not bother calculating anything
|
||||||
var windowPos = ImGui.GetMainViewport().Pos;
|
var windowPos = ImGuiHelpers.MainViewport.Pos;
|
||||||
var windowSize = ImGui.GetMainViewport().Size;
|
var windowSize = ImGuiHelpers.MainViewport.Size;
|
||||||
|
|
||||||
if (screenPos.X < windowPos.X || screenPos.X > windowPos.X + windowSize.X ||
|
if (screenPos.X < windowPos.X || screenPos.X > windowPos.X + windowSize.X ||
|
||||||
screenPos.Y < windowPos.Y || screenPos.Y > windowPos.Y + windowSize.Y)
|
screenPos.Y < windowPos.Y || screenPos.Y > windowPos.Y + windowSize.Y)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue