Rectangle.st
changeset 12946 4ee94a18811c
parent 11743 49253690b8bd
child 15730 4013efc6649a
child 18011 deb0c3355881
--- a/Rectangle.st	Sun Jul 11 17:06:50 2010 +0200
+++ b/Rectangle.st	Fri Jul 16 16:59:40 2010 +0200
@@ -656,6 +656,24 @@
     width := aPoint x - left
 !
 
+vertices
+    "return the array containing my points as a closed polygon (for Polygon compatibility)"
+
+    ^ Array 
+        with:(self topLeft)
+        with:(self topRight)
+        with:(self bottomRight)
+        with:(self bottomLeft)
+        with:(self topLeft)
+
+    "
+     (Rectangle origin:100@100 extent:20@30) vertices            
+     (Rectangle origin:100@100 extent:20@30) asPolygon vertices  
+    "
+
+    "Modified: / 16-07-2010 / 16:59:16 / cg"
+!
+
 width
     "return the width of the rectangle"
 
@@ -1799,5 +1817,9 @@
 !Rectangle class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.83 2009-06-06 10:10:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.84 2010-07-16 14:59:40 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.84 2010-07-16 14:59:40 cg Exp $'
 ! !