Mercurial > projects > dwt-mac
comparison dwt/graphics/Color.d @ 8:a9ab4c738ed8
Fix: instanceof
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 14:32:39 +0200 |
parents | e831403a80a9 |
children | d408fc12b991 |
comparison
equal
deleted
inserted
replaced
7:e831403a80a9 | 8:a9ab4c738ed8 |
---|---|
120 * | 120 * |
121 * @see #hashCode | 121 * @see #hashCode |
122 */ | 122 */ |
123 public bool equals(Object object) { | 123 public bool equals(Object object) { |
124 if (object is this) return true; | 124 if (object is this) return true; |
125 if (!(object instanceof Color)) return false; | 125 if (!( null !is cast(Color)object )) return false; |
126 Color color = cast(Color)object; | 126 Color color = cast(Color)object; |
127 float[] rgbColor = color.handle; | 127 float[] rgbColor = color.handle; |
128 if (handle is rgbColor) return true; | 128 if (handle is rgbColor) return true; |
129 return device is color.device && | 129 return device is color.device && |
130 cast(int)(handle[0] * 255) is cast(int)(rgbColor[0] * 255) && | 130 cast(int)(handle[0] * 255) is cast(int)(rgbColor[0] * 255) && |