JDK-8096486 : FX Canvas does not allow missing initial moveto commands (which HTML5 Canvas allows)
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2014-02-04
  • Updated: 2015-06-12
  • Resolved: 2014-03-01
Related Reports
Duplicate :  
Description
The attached test cases show an HTML5 example that lacks an initial moveto (It is an HTML5 tutorial example with the initial moveTo replaced by a lineTo), yet it draws the same thing that it would have drawn with the moveTo.  The similar FX Canvas example throws an Exception for the same path elements (but works if you substitute back in the moveTo).

Load test.htm into a browser to see the expected output.
Compile and run test.java to see the exception.  Modify test.java to replace the first lineTo with the indicated moveTo and it will produce the same results as the HTML file.  It should do so even with the lineTo.
Comments
Duplicate of RT-35452.
01-03-2014

Note that the HTML5 Canvas spec allows for missing initial moveto commands for any of the rendering operations - each just uses the first coordinate to create a synthetic initial moveto (i.e. curveto(cp1, cp2, ep) becomes moveto(cp1) followed by curveto(cp1, cp2, ep)). The test cases only test the lineTo command.
04-02-2014