feat: CLK toggles on Step, add pan/zoom (arrows, +/-, wheel, 0=reset)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Gate evaluation and port geometry
|
||||
import { GATE_W, GATE_H, PORT_R, gateInputCount, gateOutputCount } from './constants.js';
|
||||
import { state } from './state.js';
|
||||
import { recordSample } from './waveform.js';
|
||||
import { recordSample, setEvaluateAll } from './waveform.js';
|
||||
|
||||
export function getInputPorts(gate) {
|
||||
const count = gateInputCount(gate.type);
|
||||
@@ -61,6 +61,9 @@ export function evaluateAll() {
|
||||
if (state.recording && state.waveformVisible) recordSample();
|
||||
}
|
||||
|
||||
// Register evaluateAll in waveform to break circular dependency
|
||||
setEvaluateAll(evaluateAll);
|
||||
|
||||
export function findGateAt(x, y) {
|
||||
return state.gates.find(g => x >= g.x && x <= g.x + GATE_W && y >= g.y && y <= g.y + GATE_H);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user