brandonborkholder / glg2d

Graphics2D wrapper for JOGL
77 stars 31 forks source link

Curves #38

Closed OndrejSpanel closed 2 years ago

OndrejSpanel commented 2 years ago

Demonstrate rendering issues:

Path2D.Double shape = new Path2D.Double();

shape.moveTo(1227, 240);
shape.curveTo(1228.0, 241.0, 1228.0, 240.0, 1230.0, 240.0);
shape.curveTo(1232.0, 240.0, 1231.0, 240.0, 1233.0, 240.0);
shape.curveTo(1235.0, 240.0, 1234.0, 240.0, 1236.0, 240.0);
shape.curveTo(1238.0, 240.0, 1237.0, 240.0, 1239.0, 240.0);
shape.curveTo(1241.0, 240.0, 1240.0, 240.0, 1242.0, 240.0);
shape.curveTo(1244.0, 240.0, 1244.0, 241.0, 1245.0, 240.0);
shape.curveTo(1246.0, 239.0, 1246.0, 238.0, 1245.0, 237.0);
shape.curveTo(1244.0, 236.0, 1244.0, 237.0, 1242.0, 237.0);
shape.curveTo(1240.0, 237.0, 1240.0, 238.0, 1239.0, 237.0);
shape.curveTo(1238.0, 236.0, 1240.0, 235.0, 1239.0, 234.0);
shape.curveTo(1238.0, 233.0, 1237.0, 235.0, 1236.0, 234.0);
shape.curveTo(1235.0, 233.0, 1237.0, 232.0, 1236.0, 231.0);
shape.curveTo(1235.0, 230.0, 1235.0, 231.0, 1233.0, 231.0);
shape.curveTo(1231.0, 231.0, 1231.0, 230.0, 1230.0, 231.0);
shape.curveTo(1229.0, 232.0, 1231.0, 233.0, 1230.0, 234.0);
shape.curveTo(1229.0, 235.0, 1228.0, 233.0, 1227.0, 234.0);
shape.curveTo(1226.0, 235.0, 1227.0, 235.0, 1227.0, 237.0);
shape.curveTo(1227.0, 239.0, 1226.0, 239.0, 1227.0, 240.0);

g2d.setColor(Color.BLACK);
g2d.draw(shape);

AWT result:

image

GLG2D result:

image

OndrejSpanel commented 2 years ago

Sorry, this was not intended into this repository.

jzy3d commented 2 years ago

@OndrejSpanel this accidental PR let me discover your work on JAAGL, great!

You may be interested by using a more recent version of JOGL (2.4-RC4) that I published on my Maven FTP server. Sven, the main JOGL contributor worked on this version for years but did not published on Maven so I mainly made the last meters to have a maven distribution and added support for macOS BigSur.

yuripourre commented 2 years ago

@OndrejSpanel nice work!