xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dewe...@apache.org
Subject cvs commit: xml-batik/sources/org/apache/batik/ext/awt LinearGradientPaint.java MultipleGradientPaintContext.java RadialGradientPaint.java
Date Sat, 02 Mar 2002 02:06:32 GMT
deweese     02/03/01 18:06:32

  Modified:    sources/org/apache/batik/ext/awt LinearGradientPaint.java
                        MultipleGradientPaintContext.java
                        RadialGradientPaint.java
  Log:
  Fixed a bug that prevented gradients from working with the new Mac OS X JVM.
  
  Revision  Changes    Path
  1.2       +3 -1      xml-batik/sources/org/apache/batik/ext/awt/LinearGradientPaint.java
  
  Index: LinearGradientPaint.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/LinearGradientPaint.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LinearGradientPaint.java	23 Jan 2001 17:06:55 -0000	1.1
  +++ LinearGradientPaint.java	2 Mar 2002 02:06:32 -0000	1.2
  @@ -65,7 +65,7 @@
    *
    * @author Nicholas Talian, Vincent Hardy, Jim Graham, Jerry Evans
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: LinearGradientPaint.java,v 1.1 2001/01/23 17:06:55 tkormann Exp $
  + * @version $Id: LinearGradientPaint.java,v 1.2 2002/03/02 02:06:32 deweese Exp $
    * @see java.awt.Paint
    * @see java.awt.Graphics2D#setPaint
    *
  @@ -298,6 +298,8 @@
                                         AffineTransform transform,
                                         RenderingHints hints) {
   
  +        // Can't modify the transform passed in...
  +        transform = new AffineTransform(transform);
           //incorporate the gradient transform
           transform.concatenate(gradientTransform); 
   
  
  
  
  1.11      +4 -5      xml-batik/sources/org/apache/batik/ext/awt/MultipleGradientPaintContext.java
  
  Index: MultipleGradientPaintContext.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/MultipleGradientPaintContext.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MultipleGradientPaintContext.java	19 Feb 2002 19:22:23 -0000	1.10
  +++ MultipleGradientPaintContext.java	2 Mar 2002 02:06:32 -0000	1.11
  @@ -23,7 +23,7 @@
    *
    * @author Nicholas Talian, Vincent Hardy, Jim Graham, Jerry Evans
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: MultipleGradientPaintContext.java,v 1.10 2002/02/19 19:22:23 deweese Exp
$
  + * @version $Id: MultipleGradientPaintContext.java,v 1.11 2002/03/02 02:06:32 deweese Exp
$
    *
    */
   abstract class MultipleGradientPaintContext implements PaintContext {
  @@ -250,6 +250,7 @@
           // The inverse transform is needed to from device to user space.
           // Get all the components of the inverse transform matrix.
           AffineTransform tInv = t.createInverse();
  +
           double m[] = new double[6];
           tInv.getMatrix(m);
           a00 = (float)m[0];
  @@ -1296,8 +1297,6 @@
   
       /** Superclass getRaster... */
       public final Raster getRaster(int x, int y, int w, int h) {
  -        if ((w == 0) || (h == 0)) return null;
  -
           //
           // If working raster is big enough, reuse it. Otherwise,
           // build a large enough new one.
  @@ -1308,7 +1307,7 @@
                   raster = getCachedRaster(dataModel, w, h);
                   saved = raster;
               }
  -        //
  +
           // Access raster internal int array. Because we use a DirectColorModel,
           // we know the DataBuffer is of type DataBufferInt and the SampleModel
           // is SinglePixelPackedSampleModel.
  @@ -1328,7 +1327,7 @@
                                   model.isAlphaPremultiplied());
   
   
  -        return raster;
  +        return raster.createTranslatedChild(x, y);
       }
   
       /** Subclasses should implement this. */
  
  
  
  1.3       +3 -1      xml-batik/sources/org/apache/batik/ext/awt/RadialGradientPaint.java
  
  Index: RadialGradientPaint.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/RadialGradientPaint.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RadialGradientPaint.java	12 Jul 2001 15:07:47 -0000	1.2
  +++ RadialGradientPaint.java	2 Mar 2002 02:06:32 -0000	1.3
  @@ -81,7 +81,7 @@
    *
    * @author  Nicholas Talian, Vincent Hardy, Jim Graham, Jerry Evans
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: RadialGradientPaint.java,v 1.2 2001/07/12 15:07:47 deweese Exp $
  + * @version $Id: RadialGradientPaint.java,v 1.3 2002/03/02 02:06:32 deweese Exp $
    *
    */
   
  @@ -440,6 +440,8 @@
                                         Rectangle2D userBounds,
                                         AffineTransform transform,
                                         RenderingHints hints) {
  +        // Can't modify the transform passed in...
  +        transform = new AffineTransform(transform);
           // incorporate the gradient transform
           transform.concatenate(gradientTransform);
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Mime
View raw message