Skip to content

Node Resizer

A BlowNodeResizer in the node template gives a node resize controls on every corner and side - by default while it is selected. The toolbar sets when they show, their colour, whether the sides resize too and a size cap; the log under the canvas follows the canvas's resize events.

Resize me 160 × 70
Keep ratio 120 × 120
bit Blow

Try it

  • Click a node to select it and reveal its resize controls, then drag a corner square to resize it. The opposite corner stays put, and the size inside the node follows.
  • Drag a side - anywhere along it, not only at the middle - to resize in one direction. Untick Resize from the sides and only the corners resize.
  • Resize Keep ratio: however you drag, it stays square.
  • Nothing gets smaller than 80 × 50. Tick Cap at 280 × 180 and nothing gets larger either.
  • Set Controls to Always to show them on every node without selecting it, or Never to hide them even on a selected node.
  • Pick a Colour for the corner squares and the outline.
  • Press Escape during a resize to put the node back as it was.
  • Watch the log: one line when a resize starts, and one when it ends with the new size and how many moves it took.

How it works

  • BlowNodeResizer goes inside the node's template and draws four corner squares, an outline and four invisible side strips. Resizing writes the node's Width and Height, and its Position when the left or top edge moves.
  • Visible (null) shows the controls only while the node is selected; true or false forces them. Color (var(--bit-blow-node-selected)) paints the squares and the outline.
  • ShowEdgeControls (true) adds the side strips. They run the whole length of each side rather than sitting at the midpoints, where the connection handles are.
  • MinWidth and MinHeight (40 and 30; 80 and 50 here) and MaxWidth and MaxHeight (unbounded) limit the size, in flow units. KeepAspectRatio (false) lets the dragged axis drive the other; it is on for node 2 only.
  • The canvas raises OnNodeResizeStart, then OnNodeResize on every move, then OnNodeResizeEnd, each with the node; NodesChanged follows the end, once.
  • Both nodes start with an explicit Width and Height, and the template's content has height: 100%, so it fills the node at any size.
An unhandled error has occurred. Reload 🗙