Skip to content

Commit a4d75bf

Browse files
committed
Basic cases fixed!
1 parent 29e610b commit a4d75bf

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

lib/minigun/hud/flow_diagram.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,11 +493,11 @@ def render_fanin_connection(terminal, source_positions, to_pos, stage_data, x_of
493493
end
494494
end
495495

496-
# Draw final vertical line from merge point to target
497-
# (Only if not already covered by a center source)
498-
unless source_data.any? { |s| s[:x] == to_x }
499-
terminal.write_at(x_offset + to_x, y_offset + merge_y, "│", color: color)
500-
end
496+
# Draw junction at the converge point (center X position)
497+
# Use ┼ if there's a source directly above, ┬ if not
498+
has_center_source = source_data.any? { |s| s[:x] == to_x }
499+
junction_char = has_center_source ? "┼" : "┬"
500+
terminal.write_at(x_offset + to_x, y_offset + merge_y, junction_char, color: color)
501501
end
502502

503503
# Draw animated connection line between two boxes

spec/hud/diagrams/flow_diagram_rendering_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def normalize_output(buffer)
140140
│ ◀ path_b │ │ ◀ path_a │
141141
└────────────┘ └────────────┘
142142
│ │
143-
└────┐ ┌────┘
143+
└───────┬───────┘
144144
┌────────────┐
145145
│ ◀ merge │
146146
└────────────┘
@@ -235,6 +235,7 @@ def normalize_output(buffer)
235235
┌────────────┐
236236
│ ▶ source │
237237
└────────────┘
238+
238239
┌───────────────┼───────────────┐
239240
┌────────────┐ ┌────────────┐ ┌────────────┐
240241
│ ◀ slow │ │ ◀ process │ │ ◀ fast │
@@ -245,7 +246,7 @@ def normalize_output(buffer)
245246
│ │ ◀ process2 │ │
246247
│ └────────────┘ │
247248
│ │ │
248-
└────────────┐ │ ┌────────────┘
249+
└───────────────┼───────────────┘
249250
┌────────────┐
250251
│ ◀ final │
251252
└────────────┘

0 commit comments

Comments
 (0)