From 12574712a4be9565a03b76c8ae9f31c19bfc313d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Cicho=C5=84?= Date: Fri, 8 Mar 2024 10:12:31 +0100 Subject: [PATCH] dsn: remove temporary scaling factor The binary targets have zooming and no longer need it for display. --- src/bin/topola-sdl2-demo/main.rs | 2 +- src/dsn/design.rs | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bin/topola-sdl2-demo/main.rs b/src/bin/topola-sdl2-demo/main.rs index 907a2b5..fc53698 100644 --- a/src/bin/topola-sdl2-demo/main.rs +++ b/src/bin/topola-sdl2-demo/main.rs @@ -258,7 +258,7 @@ fn main() -> Result<(), anyhow::Error> { let board = Board::new(layout); let mut router = Router::new(board); - let mut view = View { pan: vec2f(-400.0, -300.0), zoom: 0.5 }; + let mut view = View { pan: vec2f(-80000.0, -60000.0), zoom: 0.005 }; render_times( &mut event_pump, diff --git a/src/dsn/design.rs b/src/dsn/design.rs index 50196c2..0b44113 100644 --- a/src/dsn/design.rs +++ b/src/dsn/design.rs @@ -89,10 +89,10 @@ impl DsnDesign { Shape::Circle(circle) => { let circle = Circle { pos: ( - (place.x + pin.x) as f64 / 100.0, - -(place.y + pin.y) as f64 / 100.0 + (place.x + pin.x) as f64, + -(place.y + pin.y) as f64 ).into(), - r: circle.diameter as f64 / 200.0, + r: circle.diameter as f64 / 2.0, }; layout @@ -136,8 +136,8 @@ impl DsnDesign { Shape::Polygon(_) => todo!(), }; let circle = Circle { - pos: (via.x as f64 / 100.0, -via.y as f64 / 100.0).into(), - r: circle.diameter as f64 / 200.0, + pos: (via.x as f64, -via.y as f64).into(), + r: circle.diameter as f64 / 2.0, }; layout @@ -158,11 +158,11 @@ impl DsnDesign { net: *net_id as i64, circle: Circle { pos: ( - wire.path.coord_vec[0].x as f64 / 100.0, - -wire.path.coord_vec[0].y as f64 / 100.0, + wire.path.coord_vec[0].x as f64, + -wire.path.coord_vec[0].y as f64, ) .into(), - r: wire.path.width as f64 / 200.0, + r: wire.path.width as f64 / 2.0, }, }) .unwrap(); @@ -173,8 +173,8 @@ impl DsnDesign { .add_fixed_dot(FixedDotWeight { net: *net_id as i64, circle: Circle { - pos: (coord.x as f64 / 100.0, -coord.y as f64 / 100.0).into(), - r: wire.path.width as f64 / 200.0, + pos: (coord.x as f64, -coord.y as f64).into(), + r: wire.path.width as f64 / 2.0, }, }) .unwrap(); @@ -186,7 +186,7 @@ impl DsnDesign { index, FixedSegWeight { net: *net_id as i64, - width: wire.path.width as f64 / 100.0, + width: wire.path.width as f64, }, ) .unwrap();