diff dwtx/draw2d/SWTGraphics.d @ 101:1082a0fc2bb8

First Draw2D example running
author Frank Benoit <benoit@tionex.de>
date Sun, 03 Aug 2008 02:17:46 +0200
parents 95307ad235d9
children 2d6540440fe6
line wrap: on
line diff
--- a/dwtx/draw2d/SWTGraphics.d	Sun Aug 03 00:54:29 2008 +0200
+++ b/dwtx/draw2d/SWTGraphics.d	Sun Aug 03 02:17:46 2008 +0200
@@ -74,6 +74,17 @@
     int graphicHints;
     int lineWidth;
     Clipping relativeClip;
+
+    this(){
+    }
+    this(LazyState other){
+        bgColor      = other.bgColor;
+        fgColor      = other.fgColor;
+        font         = other.font;
+        graphicHints = other.graphicHints;
+        lineWidth    = other.lineWidth;
+        relativeClip = other.relativeClip;
+    }
 }
 
 static class RectangleClipping : Clipping {
@@ -165,16 +176,18 @@
     this(){
     }
 
+    this(State other){
+        super(other);
+        affineMatrix = other.affineMatrix.dup;
+        alpha        = other.alpha;
+        bgPattern    = other.bgPattern;
+        dx           = other.dx;
+        dy           = other.dy;
+        fgPattern    = other.fgPattern;
+        lineDash     = other.lineDash.dup;
+    }
     public Object clone() {
-        auto res = new State;
-        res.affineMatrix = this.affineMatrix.dup;
-        res.alpha        = this.alpha;
-        res.bgPattern    = this.bgPattern;
-        res.dx           = this.dx;
-        res.dy           = this.dy;
-        res.fgPattern    = this.fgPattern;
-        res.lineDash     = this.lineDash.dup;
-        return res;
+        return new State(this);
     }
 
     /**