Selection Rectangle improvements

This commit is contained in:
Simon Lübeß
2025-07-05 22:36:35 +02:00
parent 736c8ce205
commit 88f6acb336
2 changed files with 79 additions and 27 deletions
+3 -3
View File
@@ -56,8 +56,8 @@ namespace ImGui
/*let storage = ImGui.GetStateStorage();
ref float selectionRectX = ref *storage.GetFloatRef(ImGui.GetID("SelectionRect.X"), float.NaN);*/
float2 minRegion = (.)ImGui.GetCursorPos() + (.)ImGui.GetWindowPos();
float2 maxRegion = minRegion + (float2)ImGui.GetContentRegionAvail();
float2 minRegion = (.)ImGui.GetWindowPos();
float2 maxRegion = (.)ImGui.GetCursorPos() + minRegion + (float2)ImGui.GetContentRegionAvail();
ImGui.DrawRect((.)minRegion, (.)maxRegion, ImGui.Color(0,1f,0));
@@ -65,7 +65,7 @@ namespace ImGui
if (isMouseDown)
{
if (!selectionValid() && IsWindowHovered())
if (!selectionValid() && IsWindowHovered() && !IsAnyItemHovered())
{
selectionRectangle.XY = (float2)ImGui.GetMousePos();
}