|
1 | | -use std::{collections::HashSet, hash::Hash, u32}; |
| 1 | +use std::{collections::HashSet, hash::Hash}; |
2 | 2 |
|
3 | 3 | use egui::{ |
4 | 4 | Align, Button, Color32, Image, Layout, Pos2, Rect, Sense, Stroke, Ui, Vec2, Widget as _, pos2, |
@@ -841,20 +841,16 @@ impl TemplateApp { |
841 | 841 | let input1_p = current.contains(&input1); |
842 | 842 | let input2_p = current.contains(&input2); |
843 | 843 |
|
844 | | - match (input1_p, input2_p) { |
845 | | - (true, true) => {} |
846 | | - (true, false) | (false, true) | (false, false) => { |
847 | | - let new_on = Pin { |
848 | | - ins: instance.id, |
849 | | - index: 1, |
850 | | - }; |
851 | | - current.insert(new_on); |
852 | | - self.flow_current(new_on, &mut current, &mut seen); |
853 | | - } |
| 844 | + if input1_p && input2_p { |
| 845 | + let new_on = Pin { |
| 846 | + ins: instance.id, |
| 847 | + index: 1, |
| 848 | + }; |
| 849 | + current.insert(new_on); |
| 850 | + self.flow_current(new_on, &mut current, &mut seen); |
854 | 851 | } |
855 | 852 | } |
856 | | - InstanceType::Wire(_) => {} |
857 | | - InstanceType::Power(_) => {} |
| 853 | + InstanceType::Wire(_) | InstanceType::Power(_) => {} |
858 | 854 | } |
859 | 855 | } |
860 | 856 | self.current = current; |
@@ -1002,14 +998,13 @@ impl TemplateApp { |
1002 | 998 | // Also add current for other pins in the other_pin instance |
1003 | 999 | let instance = self.get_instance(other_pin.ins); |
1004 | 1000 | match instance.ty { |
1005 | | - InstanceType::Gate(_) => {} |
| 1001 | + InstanceType::Gate(_) | InstanceType::Power(_) => {} |
1006 | 1002 | InstanceType::Wire(_) => { |
1007 | 1003 | for pin in instance.pins() { |
1008 | 1004 | current.insert(pin); |
1009 | 1005 | self.flow_current(pin, current, seen); |
1010 | 1006 | } |
1011 | 1007 | } |
1012 | | - InstanceType::Power(_) => {} |
1013 | 1008 | } |
1014 | 1009 | self.flow_current(other_pin, current, seen); |
1015 | 1010 | } |
|
0 commit comments