Skip to content

Commit 4dfb03e

Browse files
committed
Fix moving selected wire problem
1 parent ec41bc3 commit 4dfb03e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/app.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ impl DB {
498498
}
499499

500500
pub fn move_nonwires_and_resize_wires(&mut self, ids: &[InstanceId], delta: Vec2) {
501-
// Move all non-wire instances, then adjust connected wire endpoints
502501
for id in ids {
503502
match self.ty(*id) {
504503
InstanceKind::Gate(_) => {
@@ -509,15 +508,18 @@ impl DB {
509508
let p = self.get_power_mut(*id);
510509
p.pos += delta;
511510
}
512-
InstanceKind::Wire => {}
511+
InstanceKind::Wire => {
512+
let w = self.get_wire_mut(*id);
513+
w.start += delta;
514+
w.end += delta;
515+
}
513516
InstanceKind::CustomCircuit(_) => {
514517
let cc = self.get_custom_circuit_mut(*id);
515518
cc.pos += delta;
516519
}
517520
}
518521
}
519522

520-
// Resize wire endpoints attached to any moved instance
521523
for id in ids {
522524
for pin in self.connected_pins_of_instance(*id) {
523525
if matches!(self.ty(pin.ins), InstanceKind::Wire) {

src/connection_manager.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ pub struct ConnectionManager {
3333
/// Instances that need connection updates
3434
pub(crate) dirty_instances: HashSet<InstanceId>,
3535

36-
// pub(crate) potential_connections: HashSet<Connection>,
3736
spatial_index: HashMap<GridCell, Vec<Pin>>,
3837

3938
/// Cache of pin positions to detect when pins move

0 commit comments

Comments
 (0)