fixed possible exception in FlatUIUtils.resetRenderingHints() (issue #575)

This commit is contained in:
Karl Tauber
2022-08-12 15:41:55 +02:00
parent d2f46cd0b5
commit 2dd75c4a64
2 changed files with 5 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ FlatLaf Change Log
- Fixed missing UI value `MenuItem.acceleratorDelimiter` on macOS. (was `null`,
is now an empty string)
- Fixed possible exception in `FlatUIUtils.resetRenderingHints()`. (issue #575)
## 2.4

View File

@@ -352,8 +352,10 @@ public class FlatUIUtils
*/
public static void resetRenderingHints( Graphics g, Object[] oldRenderingHints ) {
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING, oldRenderingHints[0] );
g2.setRenderingHint( RenderingHints.KEY_STROKE_CONTROL, oldRenderingHints[1] );
if( oldRenderingHints[0] != null )
g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING, oldRenderingHints[0] );
if( oldRenderingHints[1] != null )
g2.setRenderingHint( RenderingHints.KEY_STROKE_CONTROL, oldRenderingHints[1] );
}
/**