Skip to content

Commit

Permalink
relax type constraints in BltBufferStrategy.getDrawGraphics
Browse files Browse the repository at this point in the history
  • Loading branch information
AMPivovarov committed Jan 30, 2023
1 parent e3e2438 commit 81b55d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/java.desktop/share/classes/java/awt/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -4463,10 +4463,10 @@ public Graphics getDrawGraphics() {
if (backBuffer == null) {
return getGraphics();
}
SunGraphics2D g = (SunGraphics2D)backBuffer.getGraphics();
g.constrain(-insets.left, -insets.top,
backBuffer.getWidth(null) + insets.left,
backBuffer.getHeight(null) + insets.top);
Graphics g = backBuffer.getGraphics();
((ConstrainableGraphics)g).constrain(-insets.left, -insets.top,
backBuffer.getWidth(null) + insets.left,
backBuffer.getHeight(null) + insets.top);
return g;
}

Expand Down

0 comments on commit 81b55d6

Please sign in to comment.