[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] clip with negative width or height in Graphics2D
From:       james.graham () oracle ! com (Jim Graham)
Date:       2012-12-12 18:48:33
Message-ID: 50C8D181.1020307 () oracle ! com
[Download RAW message or body]

It sounds like the code that transforms the clip does not detect if the 
rectangle is empty first.  The clip should be set to a no-area clip if 
the incoming width or height are negative (or 0)...

			...jim

On 12/12/2012 7:32 AM, Sergey Bylokhov wrote:
> Hello 2d team,
> I have a question about clipping in our implementation of SunGraphics2D.
> Currently if I set usrClip to Rectangle(100,100,-100,-100) the real clip
> will be clipRegion = 100,100,100,100;
> But if I set clip to Rectangle2D with the same coordinates the real clip
> will be clipRegion = 0,0,100,100;(This is because we normalizes usrClip
> before use).
> We automatically convert usrClip from Rectangle to Rectangle2D, if our
> graphics is scaled. So we get different clipRegion depending from scale.
> What behavior is correct? Should we always normalize usrClip before use
> or should we treat it as empty/nonexistent rectangle?
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic