aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/gnu')
-rw-r--r--libjava/gnu/awt/j2d/Graphics2DImpl.java6
-rw-r--r--libjava/gnu/awt/j2d/IntegerGraphicsState.java6
-rw-r--r--libjava/gnu/awt/xlib/XCanvasPeer.java6
3 files changed, 15 insertions, 3 deletions
diff --git a/libjava/gnu/awt/j2d/Graphics2DImpl.java b/libjava/gnu/awt/j2d/Graphics2DImpl.java
index dd46e7f..5091af6 100644
--- a/libjava/gnu/awt/j2d/Graphics2DImpl.java
+++ b/libjava/gnu/awt/j2d/Graphics2DImpl.java
@@ -175,6 +175,12 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable
public void clipRect(int x, int y, int width, int height)
{
Shape clip = state.getClip();
+ if (clip == null)
+ {
+ clip = new Rectangle (x,y,width,height);
+ setClip (clip);
+ return;
+ }
if (clip instanceof Rectangle)
{
Rectangle clipRect = (Rectangle) clip;
diff --git a/libjava/gnu/awt/j2d/IntegerGraphicsState.java b/libjava/gnu/awt/j2d/IntegerGraphicsState.java
index 4eb4c61..bcfacd0 100644
--- a/libjava/gnu/awt/j2d/IntegerGraphicsState.java
+++ b/libjava/gnu/awt/j2d/IntegerGraphicsState.java
@@ -132,9 +132,11 @@ public class IntegerGraphicsState extends AbstractGraphicsState
public Shape getClip()
{
+ if (clip == null)
+ return null;
if (clip instanceof Rectangle)
{
- Rectangle clipRect = (Rectangle) clip;
+ Rectangle clipRect = (Rectangle) ((Rectangle) clip).clone();
clipRect.x -= tx;
clipRect.y -= ty;
return clipRect;
@@ -149,6 +151,8 @@ public class IntegerGraphicsState extends AbstractGraphicsState
public Rectangle getClipBounds()
{
+ if (clip == null)
+ return null;
Rectangle clipRect = clip.getBounds();
clipRect.x -= tx;
diff --git a/libjava/gnu/awt/xlib/XCanvasPeer.java b/libjava/gnu/awt/xlib/XCanvasPeer.java
index 74e0dc2..097ad0e 100644
--- a/libjava/gnu/awt/xlib/XCanvasPeer.java
+++ b/libjava/gnu/awt/xlib/XCanvasPeer.java
@@ -247,10 +247,12 @@ public class XCanvasPeer implements CanvasPeer
gfx2d.setColor(component.getBackground());
return gfx2d;
}
-
+
+ private Rectangle locationBounds;
public Point getLocationOnScreen()
{
- throw new UnsupportedOperationException("FIXME, not implemented");
+ locationBounds = window.getBounds (locationBounds);
+ return new Point (locationBounds.x,locationBounds.y);
}
public Dimension getMinimumSize ()