comparison dwtx/draw2d/geometry/Rectangle.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
comparison
equal deleted inserted replaced
100:86617aa6b5dd 101:1082a0fc2bb8
38 public int width; 38 public int width;
39 /** the height */ 39 /** the height */
40 public int height; 40 public int height;
41 41
42 /**A singleton for use in short calculations. Use to avoid newing unnecessary objects.*/ 42 /**A singleton for use in short calculations. Use to avoid newing unnecessary objects.*/
43 public static const Rectangle SINGLETON; 43 private static Rectangle SINGLETON_;
44 44 public static Rectangle SINGLETON(){
45 static this(){ 45 if( SINGLETON_ is null ){
46 SINGLETON = new Rectangle(); 46 synchronized( Rectangle.classinfo ){
47 } 47 if( SINGLETON_ is null ){
48 48 SINGLETON_ = new Rectangle();
49 }
50 }
51 }
52 return SINGLETON_;
53 }
49 static final long serialVersionUID = 1; 54 static final long serialVersionUID = 1;
50 55
51 /** 56 /**
52 * Constructs a Rectangle at the origin with zero width and height. 57 * Constructs a Rectangle at the origin with zero width and height.
53 * 58 *