classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: request for comment on java2d stuff


From: Sascha Brawer
Subject: Re: request for comment on java2d stuff
Date: Tue, 23 Sep 2003 15:07:07 +0200

Hi Graydon,

graydon hoare <address@hidden> wrote on Tue, 2 Sep 2003 20:25:19 -0400:

>http://gcc.gnu.org/ml/java-patches/2003-q3/msg00493.html

Some more observations...

(1) Shouldn't rotate, scale & friends install new AffineTransforms if
transform == null? Otherwise, getTransform() will return wrong values.

Why don't you simply create an identity transform in the constructor? The
code would become cleaner (no checks for null transforms), and
constructing an AffineTransform should be a rather inexpensive operation.


(2) getTransform() should return a clone.


(3) setClip(Shape) should replace the current clip, while clip(Shape)
should set the new clip to the intersection of the current clip with the
specified shape. The current assignment 'clip = s' in clip(Shape) is not
correct.

public void clip(Shape s)
{
  Area area;

  area = new Area(s);
  if (clip != null)
    area.intersect(new Area(clip));
  setClip(area);
}

However, there is the unfortunate problem that Classpath does not yet
provide java.awt.geom.Area.


(4) clipRect can be implemented by passing a java.awt.Rectangle to
clip(Shape). The current implementation seems incorrect if the current
clip is not rectangular.

Best regards,

-- Sascha

Sascha Brawer, address@hidden, http://www.dandelis.ch/people/brawer/ 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]