IntegerGraphicsState.java (getClip): Clone clip before returning, handle null clip.

2006-02-23  Scott Gilbertson  <scottg@mantatest.com>

	* gnu/awt/j2d/IntegerGraphicsState.java (getClip): Clone clip
	before returning, handle null clip.
	(getClipBounds): Handle null clip.
	* gnu/awt/j2d/Graphics2DImpl.java (clipRect): Handle null clip.
	* gnu/awt/xlib/XCanvasPeer.java (): 
	(getLocationOnScreen): Implement.
	* classpath/gnu/java/awt/peer/GLightweightPeer.java
	(repaint): Merged with Classpath.
	* classpath/java/awt/Graphics.java (hitClip): Merged with
	Classpath.

From-SVN: r111395
This commit is contained in:
Scott Gilbertson
2006-02-23 20:50:49 +00:00
committed by Scott Gilbertson
parent 072b06f2dc
commit cbb5e20166
6 changed files with 37 additions and 4 deletions
+6
View File
@@ -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;
@@ -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;
+4 -2
View File
@@ -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 ()