@@ -324,6 +324,7 @@ impl App {
324324 }
325325
326326 fn is_on ( & self , pin : Pin ) -> bool {
327+ let pin = pin. is_passthrough ( & self . db ) . unwrap_or ( pin) ;
327328 let Some ( v) = self . simulator . current . get ( & pin) else {
328329 return false ;
329330 } ;
@@ -448,6 +449,7 @@ impl App {
448449 self . draw_panel_button ( ui, InstanceKind :: Gate ( GateKind :: Nor ) ) ;
449450 self . draw_panel_button ( ui, InstanceKind :: Gate ( GateKind :: Xor ) ) ;
450451 self . draw_panel_button ( ui, InstanceKind :: Gate ( GateKind :: Xnor ) ) ;
452+ self . draw_panel_button ( ui, InstanceKind :: Gate ( GateKind :: Not ) ) ;
451453 self . draw_panel_button ( ui, InstanceKind :: Power ) ;
452454 self . draw_panel_button ( ui, InstanceKind :: Lamp ) ;
453455 self . draw_panel_button ( ui, InstanceKind :: Clock ) ;
@@ -726,7 +728,7 @@ impl App {
726728 Self :: draw_grid ( ui, canvas_rect, self . viewport_offset ) ;
727729
728730 let mouse_clicked_canvas = resp. clicked ( ) ;
729- let mouse_dragging_canvas = resp. dragged ( ) ;
731+ let mouse_dragging_canvas = resp. dragged_by ( egui :: PointerButton :: Primary ) ;
730732 let double_clicked = ui. input ( |i| {
731733 i. pointer
732734 . button_double_clicked ( egui:: PointerButton :: Primary )
@@ -949,7 +951,7 @@ impl App {
949951 }
950952 }
951953
952- fn draw_instance_graphics_new (
954+ fn draw_instance_graphics (
953955 & mut self ,
954956 ui : & mut Ui ,
955957 graphics : assets:: InstanceGraphics ,
@@ -1024,15 +1026,15 @@ impl App {
10241026 let gate = self . db . circuit . get_gate ( id) ;
10251027 ( gate. pos , gate. kind )
10261028 } ;
1027- self . draw_instance_graphics_new ( ui, kind. graphics ( ) , self . adjusted_pos ( pos) , id) ;
1029+ self . draw_instance_graphics ( ui, kind. graphics ( ) , self . adjusted_pos ( pos) , id) ;
10281030 }
10291031
10301032 fn draw_power ( & mut self , ui : & mut Ui , id : InstanceId ) {
10311033 let ( pos, graphics) = {
10321034 let power = self . db . circuit . get_power ( id) ;
10331035 ( power. pos , power. graphics ( ) )
10341036 } ;
1035- self . draw_instance_graphics_new ( ui, graphics, self . adjusted_pos ( pos) , id) ;
1037+ self . draw_instance_graphics ( ui, graphics, self . adjusted_pos ( pos) , id) ;
10361038 }
10371039
10381040 fn draw_lamp ( & mut self , ui : & mut Ui , id : InstanceId ) {
@@ -1058,7 +1060,7 @@ impl App {
10581060 }
10591061 }
10601062
1061- self . draw_instance_graphics_new ( ui, graphics, pos, id) ;
1063+ self . draw_instance_graphics ( ui, graphics, pos, id) ;
10621064 }
10631065
10641066 fn draw_clock ( & mut self , ui : & mut Ui , id : InstanceId ) {
@@ -1067,7 +1069,7 @@ impl App {
10671069 ( clock. pos , clock. graphics ( ) )
10681070 } ;
10691071 let pos = self . adjusted_pos ( pos) ;
1070- self . draw_instance_graphics_new ( ui, graphics, pos, id) ;
1072+ self . draw_instance_graphics ( ui, graphics, pos, id) ;
10711073 }
10721074
10731075 fn draw_module ( & mut self , ui : & mut Ui , id : InstanceId ) {
@@ -1253,7 +1255,7 @@ impl App {
12531255 && let Some ( split_point) = self . wire_branching_action_point ( mouse, id)
12541256 {
12551257 ui. painter ( ) . circle_filled (
1256- split_point,
1258+ self . adjusted_pos ( split_point) ,
12571259 PIN_HOVER_THRESHOLD ,
12581260 COLOR_HOVER_PIN_TO_WIRE ,
12591261 ) ;
@@ -1267,7 +1269,7 @@ impl App {
12671269 && let Some ( split_point) = self . wire_branching_action_point ( mouse, id)
12681270 {
12691271 ui. painter ( ) . circle_filled (
1270- split_point,
1272+ self . adjusted_pos ( split_point) ,
12711273 PIN_HOVER_THRESHOLD ,
12721274 COLOR_HOVER_PIN_TO_WIRE ,
12731275 ) ;
@@ -1869,7 +1871,7 @@ impl App {
18691871 pos - self . viewport_offset
18701872 }
18711873
1872- fn mouse_pos_world ( & self , ui : & Ui ) -> Option < Pos2 > {
1874+ pub fn mouse_pos_world ( & self , ui : & Ui ) -> Option < Pos2 > {
18731875 ui. ctx ( )
18741876 . pointer_interact_pos ( )
18751877 . map ( |p| p + self . viewport_offset )
0 commit comments