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