]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.trend/src/org/simantics/trend/impl/ItemNode.java
Still fixes history collection value band endTime setting and rendering
[simantics/platform.git] / bundles / org.simantics.trend / src / org / simantics / trend / impl / ItemNode.java
index c866d2cc290490d9f48804193de8926af128ed9e..402d793f8cc4c34e4fbc15c5d4958f9a3635e26c 100644 (file)
@@ -248,7 +248,9 @@ public class ItemNode extends G2DNode implements TrendLayout {
                        line.lineTo(maxX, ny);
                        line.moveTo(x, y);              
                } else {
-                       line.lineTo(x, y);              
+                       if (x != currentX || y != currentY) {
+                               line.lineTo(x, y);
+                       }
                }
                
        }
@@ -427,7 +429,11 @@ public class ItemNode extends G2DNode implements TrendLayout {
                                                                }
                                                        }
 
-                                                       lineTo(x2, y2);
+                                                       // gitlab #35: t2 > t1 ensure that the value band is
+                                                       // rendered as a horizontal line until the the time when
+                                                       // the band's value went out of dead-band.
+                                                       if (flat || t2 > t1)
+                                                               lineTo(x2, y2);
                                                        
 //                                                     if(showBand) {
 //                                                             lineTo(x2, y2);
@@ -468,7 +474,7 @@ public class ItemNode extends G2DNode implements TrendLayout {
                        }
                                        
                        // Binary signal
-                       if (item.renderer == Renderer.Binary) {
+                       else if (item.renderer == Renderer.Binary) {
                                byte value = 0;
                                if (vb.getValueBinding() instanceof BooleanBinding) {
                                        value = ((Boolean) vb.getValue(Bindings.BOOLEAN)) ? (byte)0 : (byte)1;