forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-imgui-v1.92.5.patch
More file actions
79 lines (68 loc) · 3.17 KB
/
fix-imgui-v1.92.5.patch
File metadata and controls
79 lines (68 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp
index 7dee2e4..4b2ea5f 100644
--- a/imgui_node_editor.cpp
+++ b/imgui_node_editor.cpp
@@ -1659,7 +1659,8 @@ void ed::EditorContext::SetNodePosition(NodeId nodeId, const ImVec2& position)
if (node->m_Bounds.Min != position)
{
node->m_Bounds.Translate(position - node->m_Bounds.Min);
- node->m_Bounds.Floor();
+ node->m_Bounds.Min = ImFloor(node->m_Bounds.Min);
+ node->m_Bounds.Max = ImFloor(node->m_Bounds.Max);
MakeDirty(NodeEditor::SaveReasonFlags::Position, node);
}
}
@@ -1679,7 +1680,8 @@ void ed::EditorContext::SetGroupSize(NodeId nodeId, const ImVec2& size)
{
node->m_GroupBounds.Min = node->m_Bounds.Min;
node->m_GroupBounds.Max = node->m_Bounds.Min + size;
- node->m_GroupBounds.Floor();
+ node->m_GroupBounds.Min = ImFloor(node->m_GroupBounds.Min);
+ node->m_GroupBounds.Max = ImFloor(node->m_GroupBounds.Max);
MakeDirty(NodeEditor::SaveReasonFlags::Size, node);
}
}
@@ -1757,10 +1759,12 @@ void ed::EditorContext::UpdateNodeState(Node* node)
node->m_Bounds.Min = settings->m_Location;
node->m_Bounds.Max = node->m_Bounds.Min + settings->m_Size;
- node->m_Bounds.Floor();
+ node->m_Bounds.Min = ImFloor(node->m_Bounds.Min);
+ node->m_Bounds.Max = ImFloor(node->m_Bounds.Max);
node->m_GroupBounds.Min = settings->m_Location;
node->m_GroupBounds.Max = node->m_GroupBounds.Min + settings->m_GroupSize;
- node->m_GroupBounds.Floor();
+ node->m_GroupBounds.Min = ImFloor(node->m_GroupBounds.Min);
+ node->m_GroupBounds.Max = ImFloor(node->m_GroupBounds.Max);
}
void ed::EditorContext::RemoveSettings(Object* object)
@@ -3785,7 +3789,8 @@ bool ed::SizeAction::Process(const Control& control)
if ((m_Pivot & NodeRegion::Right) == NodeRegion::Right)
newBounds.Max.x = ImMax(newBounds.Min.x + minimumSize.x, Editor->AlignPointToGrid(newBounds.Max.x + dragOffset.x));
- newBounds.Floor();
+ newBounds.Min = ImFloor(newBounds.Min);
+ newBounds.Max = ImFloor(newBounds.Max);
m_LastSize = newBounds.GetSize();
@@ -5308,7 +5313,8 @@ void ed::NodeBuilder::End()
ImGui::EndGroup();
m_NodeRect = ImGui_GetItemRect();
- m_NodeRect.Floor();
+ m_NodeRect.Min = ImFloor(m_NodeRect.Min);
+ m_NodeRect.Max = ImFloor(m_NodeRect.Max);
if (m_CurrentNode->m_Bounds.GetSize() != m_NodeRect.GetSize())
{
@@ -5416,7 +5422,8 @@ void ed::NodeBuilder::PinRect(const ImVec2& a, const ImVec2& b)
IM_ASSERT(nullptr != m_CurrentPin);
m_CurrentPin->m_Bounds = ImRect(a, b);
- m_CurrentPin->m_Bounds.Floor();
+ m_CurrentPin->m_Bounds.Min = ImFloor(m_CurrentPin->m_Bounds.Min);
+ m_CurrentPin->m_Bounds.Max = ImFloor(m_CurrentPin->m_Bounds.Max);
m_ResolvePinRect = false;
}
@@ -5466,7 +5473,8 @@ void ed::NodeBuilder::Group(const ImVec2& size)
ImGui::Dummy(size);
m_GroupBounds = ImGui_GetItemRect();
- m_GroupBounds.Floor();
+ m_GroupBounds.Min = ImFloor(m_GroupBounds.Min);
+ m_GroupBounds.Max = ImFloor(m_GroupBounds.Max);
}
ImDrawList* ed::NodeBuilder::GetUserBackgroundDrawList() const