javaquery/canvas/src/main/java/net/java/html/canvas/Style.java
branchcanvas
changeset 1154 2bdd1eba1880
parent 1152 2c1c6b0f5840
child 1157 c312f00cbace
     1.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/Style.java	Mon May 27 10:24:34 2013 +0200
     1.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Style.java	Mon May 27 11:18:05 2013 +0200
     1.3 @@ -21,12 +21,16 @@
     1.4  import java.util.Objects;
     1.5  
     1.6  /**
     1.7 + * Style for Stroke and Fill of GraphicsContext. Styles are created using
     1.8 + * GraphicsContexts factory methods. If the Implementation supports it, native
     1.9 + * Styles will be cached for performance reasons. This happens the first time
    1.10 + * the Style is actually used.
    1.11   *
    1.12   * @author antonepple
    1.13   */
    1.14  public class Style {
    1.15  
    1.16 -    private Object cached;
    1.17 +    Object cached;
    1.18      private int cacheHash;
    1.19  
    1.20      Style() {
    1.21 @@ -241,6 +245,9 @@
    1.22              if (Double.doubleToLongBits(this.r1) != Double.doubleToLongBits(other.r1)) {
    1.23                  return false;
    1.24              }
    1.25 +            if ((this.getCached() == null) != (other.getCached() == null)) {
    1.26 +                return false;
    1.27 +            }
    1.28              return true;
    1.29          }
    1.30      }