Skip to content

Commit

Permalink
changed to update and draw modules before links to fix rendering bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sr14978 committed Dec 5, 2016
1 parent c355d0e commit 9b951c6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/com/modsim/gui/view/View.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,6 @@ public void paintStatic() {
drawGrid(staticG);
staticG.setTransform(oldStatic);

// Draw links
staticG.transform(wToV);
for (Link l : Main.sim.getLinks()) {
if (l == null) {
System.err.println("Warning: Null link encountered while drawing");
continue;
}
l.draw(staticG);
}

// Draw modules - static
staticG.setTransform(oldStatic);
for (BaseModule m : Main.sim.getModules()) {
Expand All @@ -146,6 +136,16 @@ public void paintStatic() {
staticG.setTransform(oldStatic);
}

// Draw links
staticG.transform(wToV);
for (Link l : Main.sim.getLinks()) {
if (l == null) {
System.err.println("Warning: Null link encountered while drawing");
continue;
}
l.draw(staticG);
}

staticG.setTransform(oldStatic);

// Static canvas is now up-to-date
Expand Down

0 comments on commit 9b951c6

Please sign in to comment.