Skip to content

v0.9.4 - final v9 branch

Latest

Choose a tag to compare

@thedmd thedmd released this 14 Oct 08:57

The last release of the 0.9 line. It builds with every Dear ImGui from 1.80 to 1.93 WIP again, takes over a hundred fixes made while working on 0.10, and brings the examples up to date. Code that uses imgui_node_editor.h builds unchanged: the header only gains two Config fields for smooth zoom, and the settings format is the same.

Development continues on develop, toward 0.10. That version requires Dear ImGui 1.89 and changes parts of the API.

Highlights

Dear ImGui 1.80 to 1.93 WIP. 0.9.4 builds with every release from 1.80 on, on the docking branch too, and with 1.93 WIP; from 1.89 on also with IMGUI_DISABLE_OBSOLETE_FUNCTIONS and IMGUI_DISABLE_OBSOLETE_KEYIO (#330, #335, #339). With ImGui 1.93, borders and the grid keep their stroke placement, and a zoomed canvas keeps its anti-aliasing. This fixes 0.9.3 issue that only some version were "blessed".

Fixes, 133 in the changelog. Among them:

  • Crashes and memory errors: freed nodes, pins and links were read after deletion. DestroyEditor() left the current editor dangling. Extra PopStyleVar()/PopStyleColor() calls and misnested BeginNode()/BeginPin() crashed release builds.
  • Hangs: a pin submitted twice in one frame, the grid at tiny zoom, and a zoom of zero in saved settings.
  • Interaction:
    • Clicks on overlapping nodes go to the widgets of the top node (#337).
    • A drag that starts in another window no longer pans the editor (#238).
    • Wheel zoom stays around the mouse while an earlier zoom is still animating.
    • A created item is offered once, not on every frame after RejectNewItem().
  • Links: hovering, rectangle selection and culling are right for straight, vertical and doubled-back links, and links between close pins no longer cross over.
  • Settings:
    • A new node takes its state from Config::LoadNodeSettings again. Since 0.9.1 that state was ignored, then overwritten with the default position.
    • Settings are written and read the same under any locale. A NaN or infinity no longer makes the file unreadable, malformed files load what they can, and a navigation saves once when it settles.
  • Canvas:
    • A canvas out of view no longer draws its content untransformed over the host window.
    • Suspend()/Resume() work inside a node (#282, #285).
    • Inputs inside the canvas get the right IME position and mouse delta.
    • Clip rectangles map back to screen space exactly.
  • crude_json: UTF-8 and escaping fixes, a nesting limit, a byte order mark is skipped, and saving goes through a temporary file, so a failed save keeps the old file.

Smooth zoom (#266), off by default: Config::EnableSmoothZoom, with Config::SmoothZoomPower for the step.

Examples:

  • They fetch Dear ImGui (thedmd/imgui feature/layout-external, 1.93 WIP with Stack Layout), stb and GLFW at pinned revisions, and need CMake 3.24. The copies in external/ are gone. To build offline, point FETCHCONTENT_SOURCE_DIR_IMGUI (and _STB, _GLFW) at local checkouts.
  • Their Dear ImGui has Stack Layout v2.1, which clips what is drawn in a layout to the layout's bounds. Code that draws outside a layout, as the blueprints example's Houdini nodes did, has to draw after the layout ends.
  • They're sharp on high-DPI displays: fonts at framebuffer density, and display scale on Windows and X11 (#254).
  • On Windows they can use GLFW and OpenGL: -DIMGUI_NODE_EDITOR_EXAMPLES_BACKEND=glfw -DIMGUI_NODE_EDITOR_EXAMPLES_RENDERER=opengl3.
  • They find their data, and keep their settings, next to the executable.
  • Many fixes in the blueprints example, and a canvas example of zooming at a fixed point (#270).

Tests: a headless test suite in tests/ runs with CTest, plus a compatibility test that runs with every Dear ImGui from 1.80. CI builds the examples on Windows, macOS and Linux, and runs the tests with MSVC, GCC and Clang across Dear ImGui releases.

Upgrading from 0.9.3

  • imgui_node_editor.h only adds Config::EnableSmoothZoom and Config::SmoothZoomPower. Nothing in it breaks, and settings files stay compatible.
  • IMGUI_NODE_EDITOR_VERSION_NUM is 904. It used to have leading zeros (000903 in 0.9.3), which made it an octal literal with the digit 9, so any #if on it failed to compile.
  • Some misuse that used to corrupt state or crash now asserts in debug builds and is ignored:
    • misnested BeginNode()/BeginPin();
    • unbalanced style pushes and pops;
    • AcceptDeletedItem()/RejectDeletedItem() without an item a query returned;
    • GetNodeBackgroundDrawList() or BeginGroupHint() inside BeginNode()/EndNode().
  • Code that uses the canvas (imgui_canvas.h) directly:
    • CanvasView keeps its origin and scale private; use Origin(), Scale(), InvScale(), SetOrigin() and SetScale().
    • Canvas::Begin() returns true also for a canvas out of view; check IsVisible() to skip drawing.
  • The minimum is Dear ImGui 1.80, the oldest release it builds with. The README used to say 1.72.

Known issues

These are fixed in 0.10, not in 0.9.4:

  • Ctrl+C, Ctrl+V, Ctrl+X, Ctrl+D and Space typed into a text field inside a node also reach the editor's shortcuts.
  • Stepped wheel zoom ignores fractional wheel deltas, as precision touchpads send. Smooth zoom handles them.
  • A node's size can differ by a pixel depending on where it is placed.

Thanks

@pthom (#339, #337, #285), @sonoro1234 (#335), @LAK132 (#330), @Marsimplodation (build fixes for Dear ImGui 1.91.5 and 1.92.6 on master), @JulesFouchy (#238), @Tianyun-Xuan (#254), @vaezim (#342) and @waywardmonkeys (#273).

Full list of changes: docs/CHANGELOG.txt