Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed display of signals: they were inverted.

  • Loading branch information...
commit bab6e444a75c17061b3b1e85599ef764435b011e 1 parent 2e4ac92
@jawi authored
View
11 client/src/main/java/nl/lxtreme/ols/client/signaldisplay/laf/SignalUI.java
@@ -479,6 +479,8 @@ private void paintSignals( final Graphics2D aCanvas, final SignalViewModel aMode
// Tell Swing how we would like to render ourselves...
aCanvas.setRenderingHints( createSignalRenderingHints( false /* aUseAA */) );
+ aCanvas.translate( 0, signalOffset );
+
if ( !signalElement.isEnabled() || ( startIdx == endIdx ) )
{
// Forced zero'd channel is *very* easy to draw...
@@ -494,7 +496,7 @@ private void paintSignals( final Graphics2D aCanvas, final SignalViewModel aMode
int prevSampleValue = ( values[startIdx] & mask );
int xValue = ( int )( zoomFactor * timestamp );
- int yValue = signalOffset + ( prevSampleValue != 0 ? signalHeight : 0 );
+ int yValue = ( prevSampleValue == 0 ? signalHeight : 0 );
x[0] = xValue;
y[0] = yValue;
@@ -510,12 +512,12 @@ private void paintSignals( final Graphics2D aCanvas, final SignalViewModel aMode
if ( prevSampleValue != sampleValue )
{
x[p] = xValue;
- y[p] = signalOffset + ( prevSampleValue != 0 ? signalHeight : 0 );
+ y[p] = ( prevSampleValue == 0 ? signalHeight : 0 );
p++;
}
x[p] = xValue;
- y[p] = signalOffset + ( sampleValue != 0 ? signalHeight : 0 );
+ y[p] = ( sampleValue == 0 ? signalHeight : 0 );
p++;
prevSampleValue = sampleValue;
@@ -523,6 +525,9 @@ private void paintSignals( final Graphics2D aCanvas, final SignalViewModel aMode
aCanvas.drawPolyline( x, y, p );
}
+
+ // Move back to the original position...
+ aCanvas.translate( 0, -signalOffset );
}
if ( signalElement.isGroupSummary() )
Please sign in to comment.
Something went wrong with that request. Please try again.