Skip to content

Commit

Permalink
fix unplaced wire drawing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhan45 committed Apr 13, 2021
1 parent 7c23a22 commit 731080c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
Binary file modified docs/simple_electronics.wasm
Binary file not shown.
34 changes: 2 additions & 32 deletions src/systems/draw_systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,44 +371,14 @@ impl<'a> System<'a> for TempWireDrawSys {

points.for_each(|sp, ep| {
// horizontal
draw_line(sp.x, sp.y, ep.x, sp.y, 5.0, color);
draw_line(sp.x, ep.y, ep.x, ep.y, 5.0, color);

// vertical
draw_line(ep.x, sp.y, ep.x, ep.y, 5.0, color);
draw_line(sp.x, sp.y, sp.x, ep.y, 5.0, color);
});
}
_ => {}
}
// match *ui_state {
// UIState::AddingWire {
// connection_entity: e,
// x_pos: None,
// y_pos: Some(_),
// ..
// } => {
// let start_pos = Pos::from_vec(position_storage.get(e).unwrap().pos).pos;

// draw_line(
// start_pos.x,
// start_pos.y,
// snap(mouse_pos.x),
// start_pos.y,
// 5.0,
// color,
// );
// }
// UIState::AddingWire {
// x_pos: Some(x_pos),
// y_pos: Some(y_pos),
// ..
// } => {
// let pos = Pos::from_vec(mouse_pos).pos;

// draw_line(snap(x_pos), snap(y_pos), snap(x_pos), pos.y, 5.0, color);
// draw_line(snap(x_pos), pos.y, pos.x, pos.y, 5.0, color);
// }
// _ => {}
// }
}
}

Expand Down

0 comments on commit 731080c

Please sign in to comment.