@@ -785,6 +785,7 @@ impl App {
785785 self . handle_deletion ( ui) ;
786786
787787 if let Some ( mouse) = mouse_pos_world {
788+ let dragging = self . drag . is_some ( ) ;
788789 let hovered_now = self . get_hovered ( mouse) ;
789790
790791 if mouse_clicked {
@@ -793,8 +794,6 @@ impl App {
793794 self . handle_drag_start_canvas ( mouse) ;
794795 }
795796
796- let dragging = self . drag . is_some ( ) ;
797-
798797 if dragging {
799798 self . handle_dragging ( ui, mouse) ;
800799 } else {
@@ -1144,6 +1143,40 @@ impl App {
11441143 }
11451144
11461145 pub fn get_hovered ( & self , mouse_pos : Pos2 ) -> Option < Hover > {
1146+ if let Some ( v) = self . drag {
1147+ match v {
1148+ Drag :: Canvas ( canvas_drag) => match canvas_drag {
1149+ crate :: drag:: CanvasDrag :: Single { id, offset : _ } => {
1150+ return Some ( Hover :: Instance ( id) ) ;
1151+ }
1152+ crate :: drag:: CanvasDrag :: Selected { .. } => { }
1153+ } ,
1154+ Drag :: Resize { id, start } => {
1155+ return Some ( Hover :: Pin ( Pin {
1156+ ins : id,
1157+ index : u32:: from ( !start) ,
1158+ } ) ) ;
1159+ }
1160+ Drag :: PinToWire {
1161+ source_pin : _,
1162+ wire_id,
1163+ } => {
1164+ // End of the new wire is hovered
1165+ return Some ( Hover :: Pin ( Pin {
1166+ ins : wire_id,
1167+ index : 1 ,
1168+ } ) ) ;
1169+ }
1170+ Drag :: BranchWire {
1171+ original_wire_id,
1172+ split_point : _,
1173+ start_mouse_pos : _,
1174+ } => {
1175+ return Some ( Hover :: Instance ( original_wire_id) ) ;
1176+ }
1177+ Drag :: Panel { .. } | Drag :: Selecting { .. } => { }
1178+ }
1179+ }
11471180 for selected in & self . selected {
11481181 match self . db . ty ( * selected) {
11491182 InstanceKind :: Wire => {
0 commit comments