diff options
author | Daniel Jones <admin@danieljon.es> | 2020-06-24 23:53:33 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2020-06-24 23:53:33 +0930 |
commit | 0b0ebd297afbd0ed302ae7b0eff25b916e3e80c2 (patch) | |
tree | 05c91a832e3e19fea6c22bf746311b4010978009 | |
parent | 91aff1783d364f3f2c814a90ec292cb89d5deb88 (diff) | |
download | foxlogicgates-0b0ebd297afbd0ed302ae7b0eff25b916e3e80c2.tar.gz foxlogicgates-0b0ebd297afbd0ed302ae7b0eff25b916e3e80c2.zip |
logic: for gates with only a single input, allow link selection on either input
-rw-r--r-- | MainWindow.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/MainWindow.cpp b/MainWindow.cpp index 8b22243..c7456ce 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -429,6 +429,14 @@ MainWindow::find_selected_input(int x, int y) { input_gate = selected_gate->get_input_gate2(); } + else + { + /* special check for gates with only one input */ + if (selected_gate->get_gate_type() == Gate::NOT || selected_gate->get_gate_type() == Gate::OUTPUT) + { + input_gate = selected_gate->get_input_gate1(); + } + } break; } @@ -625,20 +633,6 @@ MainWindow::on_key_release(FXObject *sender, FXSelector sel, void *ptr) } else if (selected_gate) { - /* delete gate and all associations */ - /* - * 2 inputs - * x outputs - * - * inputs: - * if input1/2 != null: - * call their remove_gate_id with this gate id - * update that gate - * outputs: - * iterate through ouputs - * call remove_input_gate with this gate id - * update that gate - */ Gate *gate; /* delete inputs */ if (selected_gate->get_input_gate1()) |