Skip to content

Commit 1560f87

Browse files
committed
Editor: Allow nodes with zero size (#134)
1 parent 6c834d8 commit 1560f87

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/CHANGELOG.txt

+2
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,6 @@ v0.9.1 (WIP):
157157
BUGFIX: Editor: Make off-screen dragging work again
158158

159159
BUGFIX: ImGui: Disable obsolete functions (#103)
160+
161+
BUGFIX: Editor: Allow nodes with zero size (#134)
160162

imgui_node_editor.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2228,8 +2228,8 @@ ed::Control ed::EditorContext::BuildControl(bool allowOffscreen)
22282228
if (window->SkipItems)
22292229
return false;
22302230

2231-
// Cannot use zero-size for InvisibleButton(). Unlike Button() there is not way to fallback using the label size.
2232-
IM_ASSERT(size_arg.x != 0.0f && size_arg.y != 0.0f);
2231+
if (size_arg.x == 0.0f || size_arg.y == 0.0f)
2232+
return false;
22332233

22342234
const ImGuiID id = window->GetID(str_id);
22352235
ImVec2 size = CalcItemSize(size_arg, 0.0f, 0.0f);

0 commit comments

Comments
 (0)