Use ConstrainableGraphics when possible.
authorRoman Kennke <roman.kennke@aicas.com>
Tue Feb 24 16:36:09 2009 +0100 (12 months ago)
changeset 161b504c176d467
parent 160f5fcefae4989
child 162043120f7c702
Use ConstrainableGraphics when possible.
src/sun/awt/peer/cacio/ManagedWindow.java
--- a/src/sun/awt/peer/cacio/ManagedWindow.java Tue Feb 24 16:35:42 2009 +0100
+++ b/src/sun/awt/peer/cacio/ManagedWindow.java Tue Feb 24 16:36:09 2009 +0100
@@ -47,6 +47,7 @@ import java.util.List;
import java.util.List;
import sun.awt.CausedFocusEvent.Cause;
+import sun.awt.ConstrainableGraphics;
import sun.java2d.pipe.Region;
import sun.awt.peer.cacio.CacioComponent.EventPriority;
@@ -159,7 +160,12 @@ public class ManagedWindow
// Ask parent for clipped graphics.
Graphics2D pg = parent.getClippedGraphics(clipRects);
// Translate and clip to our own coordinate system.
- return (Graphics2D) pg.create(x, y, width, height);
+ if (pg instanceof ConstrainableGraphics) {
+ ((ConstrainableGraphics) pg).constrain(x, y, width, height);
+ } else {
+ pg = (Graphics2D) pg.create(x, y, width, height);
+ }
+ return pg;
}
/**