Skip to content

std::terminate lives in the <exception> header #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crude_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# include "crude_json.h"
# include <iomanip>
# include <limits>
# include <exception>
# include <cstdlib>
# include <clocale>
# include <cmath>
Expand Down
3 changes: 3 additions & 0 deletions imgui_node_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,12 @@ void ed::Node::UpdateDrag(const ImVec2& offset)
auto size = m_Bounds.GetSize();
m_Bounds.Min = ImFloor(m_DragStart + offset);
m_Bounds.Max = m_Bounds.Min + size;
m_userPositioned = m_Bounds.Min != m_DragStart;
}

bool ed::Node::EndDrag()
{
m_userPositioned = m_Bounds.Min != m_DragStart;
return m_Bounds.Min != m_DragStart;
}

Expand Down Expand Up @@ -1647,6 +1649,7 @@ void ed::EditorContext::SetNodePosition(NodeId nodeId, const ImVec2& position)

if (node->m_Bounds.Min != position)
{
node->m_userPositioned = false;
node->m_Bounds.Translate(position - node->m_Bounds.Min);
node->m_Bounds.Floor();
MakeDirty(NodeEditor::SaveReasonFlags::Position, node);
Expand Down
2 changes: 1 addition & 1 deletion imgui_node_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ IMGUI_NODE_EDITOR_API ImVec2 CanvasToScreen(const ImVec2& pos);
IMGUI_NODE_EDITOR_API int GetNodeCount(); // Returns number of submitted nodes since Begin() call
IMGUI_NODE_EDITOR_API int GetOrderedNodeIds(NodeId* nodes, int size); // Fills an array with node id's in order they're drawn; up to 'size` elements are set. Returns actual size of filled id's.


IMGUI_NODE_EDITOR_API bool GetWasUserPositioned(NodeId node);



Expand Down
8 changes: 8 additions & 0 deletions imgui_node_editor_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,3 +760,11 @@ int ax::NodeEditor::GetOrderedNodeIds(NodeId* nodes, int size)
{
return s_Editor->GetNodeIds(nodes, size);
}

bool ax::NodeEditor::GetWasUserPositioned(ax::NodeEditor::NodeId nodeId)
{
if (auto node = s_Editor->FindNode(nodeId)) {
return node->m_userPositioned;
}
return false;
}
2 changes: 2 additions & 0 deletions imgui_node_editor_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ struct Node final: Object

bool m_RestoreState;
bool m_CenterOnScreen;
bool m_userPositioned;

Node(EditorContext* editor, NodeId id)
: Object(editor)
Expand All @@ -422,6 +423,7 @@ struct Node final: Object
, m_HighlightConnectedLinks(false)
, m_RestoreState(false)
, m_CenterOnScreen(false)
, m_userPositioned(false)
{
}

Expand Down