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/test-references/org/apache/batik/ext/awt/geom rlm.merge.in
Date Tue, 19 Feb 2002 19:22:23 GMT
deweese     02/02/19 11:22:23

  Modified:    sources/org/apache/batik/ext/awt
                        MultipleGradientPaintContext.java
               sources/org/apache/batik/ext/awt/geom RectListManager.java
               test-references/org/apache/batik/ext/awt/geom rlm.merge.in
  Log:
  1) Fixed a bug on Gradients with zero w/h
  2) Fixed an infinate loop in merging rects (requires a really bizzare
     input list of rects).
  
  Revision  Changes    Path
  1.10      +6 -1      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MultipleGradientPaintContext.java	13 Sep 2001 21:55:52 -0000	1.9
  +++ MultipleGradientPaintContext.java	19 Feb 2002 19:22:23 -0000	1.10
  @@ -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.9 2001/09/13 21:55:52 deweese Exp
$
  + * @version $Id: MultipleGradientPaintContext.java,v 1.10 2002/02/19 19:22:23 deweese Exp
$
    *
    */
   abstract class MultipleGradientPaintContext implements PaintContext {
  @@ -1296,6 +1296,8 @@
   
       /** 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.
  @@ -1353,6 +1355,9 @@
                       }
               }
           }
  +        // Don't create rediculously small rasters...
  +        if (w<32) w=32;
  +        if (h<32) h=32;
           return cm.createCompatibleWritableRaster(w, h);
       }
   
  
  
  
  1.3       +4 -2      xml-batik/sources/org/apache/batik/ext/awt/geom/RectListManager.java
  
  Index: RectListManager.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/geom/RectListManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RectListManager.java	19 Feb 2002 18:01:29 -0000	1.2
  +++ RectListManager.java	19 Feb 2002 19:22:23 -0000	1.3
  @@ -27,7 +27,7 @@
    * this reason it uses Rectangle not Rectangle2D).
    *
    * @author <a href="mailto:deweese@apache.org">Thomas DeWeese</a>
  - * @version $Id: RectListManager.java,v 1.2 2002/02/19 18:01:29 deweese Exp $ */
  + * @version $Id: RectListManager.java,v 1.3 2002/02/19 19:22:23 deweese Exp $ */
   
   public class RectListManager implements Collection {
       Rectangle [] rects = null;
  @@ -527,6 +527,7 @@
           mr = new Rectangle();
           for (int j, i=1; i<size; i++) {
               r = rects[i];
  +            if (r == null) continue;
               cost1 = (overhead                 + 
                        (r.height*lineOverhead) +
                        (r.height*r.width));
  @@ -545,7 +546,8 @@
                       if (cost3 <= cost1+cost2) {
                           rects[j] = mr;
                           rects[i] = null;
  -                        r = mr;
  +                        i     = j; j=-1;
  +                        r     = mr;
                           cost1 = cost3;
                           break;
                       }
  
  
  
  1.2       +0 -2      xml-batik/test-references/org/apache/batik/ext/awt/geom/rlm.merge.in
  
  Index: rlm.merge.in
  ===================================================================
  RCS file: /home/cvs/xml-batik/test-references/org/apache/batik/ext/awt/geom/rlm.merge.in,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- rlm.merge.in	12 Feb 2002 18:17:44 -0000	1.1
  +++ rlm.merge.in	19 Feb 2002 19:22:23 -0000	1.2
  @@ -75,5 +75,3 @@
   # Should collapse (overhead overcomes)
   merge 440 11
   print
  -
  -
  
  
  

---------------------------------------------------------------------
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