brandonborkholder / glg2d

Graphics2D wrapper for JOGL
77 stars 31 forks source link

Support setting antialiasing hints to null #36

Open OndrejSpanel opened 5 years ago

OndrejSpanel commented 5 years ago

It is currently not possible to call setRenderingHint(key, null). This causes issues when using GLGraphics2D with Flying Saucer (https://github.com/flyingsaucerproject/flyingsaucer), as it is using following pattern:

   // set
   Object aaHint = graphics.getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING);
   graphics.setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING, antiAliasRenderingHint );

   // restore
   graphics.setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING, aaHint );

As there are no hints by default, the initial value for all hints when queried is null. Not accepting null in getRenderingHint makes restoring initial value impossible.