Skip to content

Commit 34fa0d4

Browse files
committed
Fixed drawing order in graph object
1 parent dd7e1c8 commit 34fa0d4

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

listener/Graph.java

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,24 +171,15 @@ public void Plot()
171171
double yScale = AXIS_COV * this.height / ( this.extremes[3] - this.extremes[2] );
172172
double yOffset = yScale * this.extremes[3] + 0.5 * ( 1.0 - AXIS_COV ) * this.height;
173173

174-
// X vs Y and vs Time specific stuff
174+
// Modify scaling and offset
175175
if ( this.xvy )
176176
{
177-
this.DrawXYStuff();
178-
179-
// Modify scaling and offset
180177
xScale *= AXIS_COV;
181178
xOffset = xScale * this.extremes[0] - 0.5 * ( 1.0 - AXIS_COV ) * this.width;
182179
}
183-
else
184-
{
185-
this.DrawTimeStuff();
186-
}
187180

188-
// Draw Ticks
189-
this.DrawTicks( xScale, xOffset, yScale, yOffset );
190181

191-
// Do actual data plotting
182+
// Do actual data plotting
192183
for ( int i = 0; i < this.numVars; i++ )
193184
{
194185
this.parent.stroke( this.colors[i] );
@@ -197,7 +188,21 @@ public void Plot()
197188
this.parent.point( (float)(this.posX + (this.data[j][i][0]*xScale - xOffset)),
198189
(float)(this.posY + yOffset - data[j][i][1]*yScale) );
199190
}
191+
}
192+
193+
// X vs Y and vs Time specific stuff
194+
if ( this.xvy )
195+
{
196+
this.DrawXYStuff();
197+
}
198+
else
199+
{
200+
this.DrawTimeStuff();
200201
}
202+
203+
// Draw Ticks
204+
this.DrawTicks( xScale, xOffset, yScale, yOffset );
205+
201206
}
202207

203208
// Private Helpers

0 commit comments

Comments
 (0)