Repository navigation
v0.12.0
.gtui format 10 (reads v1..v10). Crate 0.12.0.
Added
examples/fun/hongloumeng.gtui: 30 characters from Dream of the Red Chamber plus a title and five colour-coded relationship legends, with 32 undirected edges (blood, marriage, love, servant, kin).
Fixed
- Self-loops were drawn twice when the planning pass went in: the loop owns border cells, so the
planning copy took a port and the drawing copy picked a different one, which collapsed the loop
into a straight line.edge_loopnow only records nothing during planning (a loop is short and
does not need to block other edges). A loop on anone-style (one-row) node also stopped hiding
behind the normal port scan when its side was already taken by other edges -- it goes to the side
centre instead, so it stays visible. - Two
none-style boxes whose texts end up on top of each other no longer erase single characters.
Text is drawn for the box under the cursor / being dragged first and a box whose text would land
on already drawn text now yields as a whole, instead of painting its wide-character continuation
cells (a space) over the other box's first character, which looked like that character had
disappeared. This only showed up with CJK names because those cells carry a half of a glyph. - An explicit
from_side/to_sidethat points away from the other box is now ignored: the edge
used to leave the left side and arrive at the right side of a box that sits to its left, wrapping
around the whole picture. A pin that only loses to a shorter way (sayupwith the target below
and to the right) is still honoured, so the port can still be chosen on purpose.
Changed
-
The planned routes are cached (last four document/view combinations, keyed by the document
revision, the box/edge geometry, the zoom, the viewport origin and the view switches that change
which edges are drawn). Cursor movement, selection, menus and switching back to an already drawn
tab no longer route anything; panning, zooming or editing re-routes. The cache lives in the
renderer and is never written anywhere. -
layered/tree/chainlayouts now record the row of every node, and an edge between two
adjacent rows always leaves from the lower side and arrives at the upper side instead of picking
the side from the two centres. A rank therefore reads as one vertical channel and the ports line
up by column; edges that span more than one row keep the old centre-based choice, which keeps long
spans from detouring around whole rows. The rows are not written to the file (they are redone by
the next layout) and are dropped when the box count changes. -
Routing gained a planning pass: every edge in every layer is routed once with the already planned
routes of the earlier edges as a soft penalty, and the drawing pass then follows those planned
polylines instead of routing again. Two edges of the same group no longer run along one stroke
(where the later one would be invisible), and a frame still costs one routing round rather than
two. Edges whose endpoints are both point nodes, and edges withviapoints, are planned with
the same pass but still recompute their (cheaper) L / straight legs while drawing. -
Ports are assigned per edge instead of "at most two anchors per side": three or more edges on one
side of a wide enough box now each take their own cell, and so do three or more arrowheads. The
cell is chosen so both ends line up (two facing boxes no longer jog by a cell) and stays near the
content centre; assignment walks the file order, so adding an edge never moves existing ports.
When a side is full, an arrowhead moves to the neighbouring side of that endpoint and a plain
line may merge into the nearest junction (drawn as aT); a box too small at the current zoom
keeps the old "scan the border for a free cell" behaviour, which also keeps arrows off the
corners. -
Routing picks paths by a weighted cost instead of lexicographic (bends, then cost): length,
10 per bend, 25 per crossing, 40 per cell that would reuse another edge's stroke (a reused stroke
makes the later edge invisible for that stretch) and 6 for another group's ink. Fixed shapes are
still tried first, but a detour that avoids a long shared stroke now wins, with a detour cap
(3x the Manhattan distance + 40). -
The A* fallback searches a 6-cell window first, then 24, then the whole document frame, so a box
taller than the old fixed window no longer makes the edge stop at its border. Edge pairs whose
endpoints are point nodes are routed with the same obstacle-aware code instead of a blind L (they
used to be drawn straight through a box, which looked like a broken line because the box covers
the stroke). -
Right drag is context-sensitive: on empty space or an edge it pans (2 cells of movement), and on
a box it links that box — drag to another box and release to create the edge, release on empty
space to cancel, release on the source for a self-loop. Under two cells it is still the menu
click. Any box style works, includingpoint/none. -
A dashed preview now follows the pointer for every kind of linking (right drag from a box, left
drag from a border,emode): with a box under the pointer the line runs to that box, otherwise
it runs to the cursor cell, so the direction is visible before you reach a target. The preview
never touches the document, never covers a box and never costs an undo step. -
Editing and clipboard are one-box-at-a-time now:
iedits only the box under the cursor (a
block selection is refused with a hint instead of writing one text into several boxes), and
<|new box|>splitting applies to the in-place commit too. -
Ssplits the cursor box between the cursor line and the next one (first part stays, the rest
moves into a new box on the right with the same style / colours / alignment / layer; edges stay
with the original; refused on the last line, apointnode and an edge note). -
Mmerges the selected boxes into the one under the cursor (else the first in reading order):
texts joined with\n, internal edges dropped, boundary edges re-pointed at the merged box and
duplicates collapsed, one undo step. -
yyanks a picture fragment without touching the document.yanddshare one rule: the
clipboard holds the boxes, their texts and the edges with both ends inside the selection
(plus explicitly selected edges), whiledstill removes every edge touching the removed boxes. -
Default keys removed:
t(the prompt path is:text),a(:notes),x(dcuts; the
"boxes only" variant is gone),V,Ctrl-q,Ctrl-i,z,=and_.toggle_labelsmoved
frombtoB.toggle_notesandconfirm_selectionstay bindable but have no default key.