Don't draw wires that are off screen

master
LeRoyce Pearson 2022-01-23 15:44:07 -07:00
parent 0f64806045
commit 77a3fb166e
1 changed files with 1 additions and 0 deletions

View File

@ -554,6 +554,7 @@ fn wireDrawProcess(_: f32, wire: *Wire) void {
if (!inView(wire.begin().pos) or !inView(wire.end().pos)) return; if (!inView(wire.begin().pos) or !inView(wire.end().pos)) return;
var nodes = wire.nodes.slice(); var nodes = wire.nodes.slice();
if (nodes.len == 0) return; if (nodes.len == 0) return;
if (!inView(nodes[0].pos)) return;
w4.DRAW_COLORS.* = if (wire.enabled) 0x0002 else 0x0003; w4.DRAW_COLORS.* = if (wire.enabled) 0x0002 else 0x0003;
for (nodes) |node, i| { for (nodes) |node, i| {