Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/dhmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,18 @@ var dhmap = {};

// Draw a network switch. Defaults to amber colour
function renderSwitch(object, dry) {
object.width = object.width + 1.7;
object.height = object.height + 1.7;
object.x1 = object.x1 - 1;
object.y1 = object.y1 - 0.7;
if(object.horizontal) {
object.width = object.width + 1.7;
object.height = object.height + 1.7;
object.x1 = object.x1 - 0.7 - (object.width/2);
object.y1 = object.y1 - 0.7;
} else {
y_offset = object.height/2
object.width = object.width + 1.7;
object.height = object.height + 1.7;
object.x1 = object.x1 - 0.7;
object.y1 = object.y1 - 0.7 - (object.height/2);
}
switches[object.name] = object;
renderRectangle(object, dhmap.colour.UNKNOWN, false, dry);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ipplan2dhmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
c.execute(
'SELECT name, horizontal, "table" AS class, hall, x1, y1, x2, y2, width, height FROM table_coordinates'

' UNION SELECT sc.name, 0 AS horizontal, "switch" AS class, tc.hall hall, sc.x + 5 AS x1, sc.y + 5 AS y1, sc.x + 5 AS x2,'
' UNION SELECT sc.name, tc.horizontal AS horizontal, "switch" AS class, tc.hall hall, sc.x + 5 AS x1, sc.y + 5 AS y1, sc.x + 5 AS x2,'
' sc.y + 5 AS y1, 5 AS width, 5 AS height '
' FROM switch_coordinates sc '
' INNER JOIN table_coordinates tc ON sc.table_name = tc.name'
Expand Down