[4068] in java-interest

home help back first fref pref prev next nref lref last post

clipRect() bug? - Help!

daemon@ATHENA.MIT.EDU (Dave Lennert)
Fri Dec 8 22:17:24 1995

To: java-interest@java.sun.com
Date: Fri, 08 Dec 95 17:35:35 PST
From: Dave Lennert <davel@ibeam.jf.intel.com>

During a single update() (screen painting) I want to establish different
clipping rectangles for the different objects I'm rendering on the screen.

The Graphics class has getClipRect() to retrieve the current setting.
It has clipRect() to set the clipping rectangle to the *intersection*
of the current setting and a new rectangle.  But it apparently has no 
method to restore (enlarge) the clipping rectangle.

It does have the create() method which supposedly creates a copy of the
Graphics object that one can call clipRect() against without affecting
the original Graphics object.  This appears to work EXCEPT IN THE
FOLLOWING CASE.

When the Graphics object is an offscreen Image (for double buffering)
from Component.createImage(w,h).getGraphics(), the new Graphics object
returned from create() apparently shares it's clipping rectangle
settings with the original Image Graphics object.  That is, a
clipRect() on the new Graphics objects affects the old Graphics object
as well.

Since this works against a regular Graphics object, this sounds like a
bug.  At any rate, is there a way to somehow enlarge the clipping rect
once you've reduced it?
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post