fix: only allow pinning/clickthrough if the window is within the main viewport

This commit is contained in:
goat 2023-11-07 19:27:45 +01:00
parent f10a597566
commit c03d6ff048
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
2 changed files with 30 additions and 6 deletions

View file

@ -25,6 +25,13 @@ public static class ImGuiHelpers
/// </summary>
public static float GlobalScale { get; private set; }
/// <summary>
/// Check if the current ImGui window is on the main viewport.
/// Only valid within a window.
/// </summary>
/// <returns>Whether the window is on the main viewport.</returns>
public static bool CheckIsWindowOnMainViewport() => MainViewport.ID == ImGui.GetWindowViewport().ID;
/// <summary>
/// Gets a <see cref="Vector2"/> that is pre-scaled with the <see cref="GlobalScale"/> multiplier.
/// </summary>