title: JavaFx custom grid painting issue
body: <p>I am using the below code to paint vertical lines on a JavaFX Canvas. Somehow the final lines(last 10%) have lower opacity. I have not changed any options(Transform/Effect on gc). I am attaching a screenshot for reference, any idea?</p>
  
  <pre><code>public class ChartPane extends StackPane {
  
      Canvas canvas;
  
      public ChartPane() {
  
          setStyle("-fx-background-color: white;");
          canvas = new Canvas(getWidth(), getHeight()); 
          getChildren().add(canvas);
  
          widthProperty().addListener(new ChangeListener&lt;Number&gt;() {
  
              @Override
              public void changed(ObservableValue&lt;? extends Number&gt; observable, Number oldValue, Number newValue) {
                  canvas.setWidth(newValue.intValue());
              }
          });
  
          heightProperty().addListener(new ChangeListener&lt;Number&gt;() {
  
              @Override
              public void changed(ObservableValue&lt;? extends Number&gt; observable, Number oldValue, Number newValue) {
                  canvas.setHeight(newValue.intValue());
              }
          });
      }
  
      @Override
      protected void layoutChildren() {
          super.layoutChildren(); 
  
          GraphicsContext gc = canvas.getGraphicsContext2D(); 
          gc.save();
          gc.clearRect(0, 0, getWidth(), getHeight());
  
          System.out.println(getWidth() + ", " + getHeight());
  
          // vertical lines
          gc.setStroke(Color.BLUE);
          gc.setLineWidth(0.1);
          gc.beginPath();
          for(int i = 0 ; i &lt; getWidth() ; i+=30){
              gc.moveTo(i, 0);
              gc.lineTo(i, getHeight() - (getHeight()%30));            
              gc.stroke();
          }        
  
          // horizontal lines
          gc.beginPath();
          gc.setStroke(Color.RED);
          for(int i = 30 ; i &lt; getHeight() ; i+=30){
              gc.moveTo(30, i);
              gc.lineTo(getWidth(), i);              
              gc.stroke();   
          }        
          //gc.restore();
      }    
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ASwsr.png" alt="enter image description here"></p>