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/gvt UpdateTracker.java
Date Tue, 12 Feb 2002 18:58:31 GMT
deweese     02/02/12 10:58:31

  Modified:    sources/org/apache/batik/gvt UpdateTracker.java
  Log:
  1) Fixed a bug in the handling of update regions for nodes that
     had a null transform (mostly fixes transform.svg).
  
  Revision  Changes    Path
  1.7       +17 -8     xml-batik/sources/org/apache/batik/gvt/UpdateTracker.java
  
  Index: UpdateTracker.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/gvt/UpdateTracker.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- UpdateTracker.java	11 Feb 2002 13:14:29 -0000	1.6
  +++ UpdateTracker.java	12 Feb 2002 18:58:31 -0000	1.7
  @@ -29,7 +29,7 @@
    * This class tracks the changes on a GVT tree
    *
    * @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
  - * @version $Id: UpdateTracker.java,v 1.6 2002/02/11 13:14:29 hillion Exp $
  + * @version $Id: UpdateTracker.java,v 1.7 2002/02/12 18:58:31 deweese Exp $
    */
   public class UpdateTracker extends GraphicsNodeChangeAdapter {
   
  @@ -76,8 +76,8 @@
               Rectangle2D srcNRgn = gn.getBounds();
               AffineTransform nat = gn.getTransform();
               nodeBounds.put(gnWRef, srcNRgn); // remember the new bounds...
  -            // System.out.println("Old: " + srcORgn);
  -            // System.out.println("New: " + srcNRgn);
  +            // System.out.println("Rgns: " + srcORgn + " - " + srcNRgn);
  +            // System.out.println("ATs: " + oat + " - " + nat);
               Shape oRgn = srcORgn;
               Shape nRgn = srcNRgn;
   
  @@ -119,6 +119,10 @@
   
               if (gn == null) {
                   // We made it to the root graphics node so add them.
  +                // System.out.println
  +                //     ("Adding: " + oat + " - " + nat + "\n" +
  +                //      org.ImageDisplay.stringShape(oRgn) + "\n" +
  +                //      org.ImageDisplay.stringShape(nRgn) + "\n");
                   ret.add(oRgn);
                   ret.add(nRgn);
               }
  @@ -137,14 +141,19 @@
           GraphicsNode gn = gnce.getGraphicsNode();
           WeakReference gnWRef = gn.getWeakReference();
   
  +        boolean doPut = false;
           if (dirtyNodes == null) {
               dirtyNodes = new HashMap();
  -            dirtyNodes.put(gnWRef, gn.getTransform());
  -        } else {
  -            Object o = dirtyNodes.get(gnWRef);
  -            if (o == null)
  -                dirtyNodes.put(gnWRef, gn.getTransform());
  +            doPut = true;
  +        } else if (!dirtyNodes.containsKey(gnWRef)) 
  +            doPut = true;
  +
  +        if (doPut) {
  +            AffineTransform at = gn.getTransform();
  +            if (at != null) at = (AffineTransform)at.clone();
  +            dirtyNodes.put(gnWRef, at);
           }
  +
   
           Object o = nodeBounds.get(gnWRef);
           while (o == null) {
  
  
  

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