Rectangle.st
changeset 308 f04744ef7b5d
parent 293 31df3850e98c
child 325 46bca6125b93
--- a/Rectangle.st	Thu Mar 09 11:52:57 1995 +0100
+++ b/Rectangle.st	Sat Mar 18 06:06:59 1995 +0100
@@ -14,14 +14,14 @@
        instanceVariableNames:'left top width height'
        classVariableNames:''
        poolDictionaries:''
-       category:'Graphics-Primitives'
+       category:'Graphics-Geometry'
 !
 
 Rectangle comment:'
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.15 1995-03-06 19:17:42 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.16 1995-03-18 05:06:00 claus Exp $
 '!
 
 !Rectangle class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.15 1995-03-06 19:17:42 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.16 1995-03-18 05:06:00 claus Exp $
 "
 !
 
@@ -132,21 +132,24 @@
     int spc;
 
     if (_CanDoQuickNew(OHDR_SIZE + 4*sizeof(OBJ))) {
+	if (self == Rectangle) {
 	/* short cut - rectangles are created so often ... */
-	if (self == Rectangle) {
 	    _qCheckedAlignedNew(newRect, OHDR_SIZE + 4*sizeof(OBJ));
 
 	    _InstPtr(newRect)->o_class = Rectangle;
-	    spc = _qSpace(newRect);
-
 	    _InstPtr(newRect)->i_instvars[0] = left;
-	    __STORE_SPC(newRect, left, spc);
 	    _InstPtr(newRect)->i_instvars[1] = top;
-	    __STORE_SPC(newRect, top, spc);
 	    _InstPtr(newRect)->i_instvars[2] = w;
-	    __STORE_SPC(newRect, w, spc);
 	    _InstPtr(newRect)->i_instvars[3] = h;
-	    __STORE_SPC(newRect, h, spc);
+
+	    if (! (__bothSmallInteger(left, top) && 
+		   __bothSmallInteger(w, h))) {
+		spc = _qSpace(newRect);
+		__STORE_SPC(newRect, left, spc);
+		__STORE_SPC(newRect, top, spc);
+		__STORE_SPC(newRect, w, spc);
+		__STORE_SPC(newRect, h, spc);
+	    }
 
 	    RETURN ( newRect );
 	}