Skip to content

Commit 9b951c6

Browse files
committed
changed to update and draw modules before links to fix rendering bug
1 parent c355d0e commit 9b951c6

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/com/modsim/gui/view/View.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,6 @@ public void paintStatic() {
127127
drawGrid(staticG);
128128
staticG.setTransform(oldStatic);
129129

130-
// Draw links
131-
staticG.transform(wToV);
132-
for (Link l : Main.sim.getLinks()) {
133-
if (l == null) {
134-
System.err.println("Warning: Null link encountered while drawing");
135-
continue;
136-
}
137-
l.draw(staticG);
138-
}
139-
140130
// Draw modules - static
141131
staticG.setTransform(oldStatic);
142132
for (BaseModule m : Main.sim.getModules()) {
@@ -146,6 +136,16 @@ public void paintStatic() {
146136
staticG.setTransform(oldStatic);
147137
}
148138

139+
// Draw links
140+
staticG.transform(wToV);
141+
for (Link l : Main.sim.getLinks()) {
142+
if (l == null) {
143+
System.err.println("Warning: Null link encountered while drawing");
144+
continue;
145+
}
146+
l.draw(staticG);
147+
}
148+
149149
staticG.setTransform(oldStatic);
150150

151151
// Static canvas is now up-to-date

0 commit comments

Comments
 (0)