Rectangle.st
changeset 1151 7991d983b17d
parent 1149 69b30e3494fa
child 1245 c8afea3d5af0
--- a/Rectangle.st	Wed Apr 10 21:52:21 1996 +0200
+++ b/Rectangle.st	Wed Apr 10 22:15:20 1996 +0200
@@ -416,6 +416,7 @@
 
 %{  /* NOCONTEXT */
     /*
+     * because rectangles are often compared in the graphics code,
      * handle the common case quickly
      */
     if (__isNonNilObject(aRectangle) 
@@ -433,8 +434,7 @@
 	    RETURN ( false );
 	}
     }
-%}
-.
+%}.
     (aRectangle species ~~ self species) ifTrue:[^ false].
 
     left = aRectangle left ifFalse:[^ false].
@@ -479,33 +479,33 @@
 asLayout
     "return a layoutFrame in which offsets (top, left, bottom, right)
      are taken from corresponding edges of the receiver.
-     If all values are between 0..1, a fractionalLayout is created,
+     If all values are between 0.0 .. 1.0, a fractionalLayout is created,
      otherwise, an offsetLayout"
 
-    |l left right top bot|
+    |newLayout left right top bot|
 
-    l := LayoutFrame new.
+    newLayout := LayoutFrame new.
     left := (self left).
     right := (self right).
     top := (self top).
     bot := (self bottom).
-    ((left between:0 and:1)
-    and:[(right between:0 and:1)
-    and:[(top between:0 and:1)
-    and:[(bot between:0 and:1)]]]) ifTrue:[
-	l
+    ((left between:0.0 and:1.0)
+    and:[(right between:0.0 and:1.0)
+    and:[(top between:0.0 and:1.0)
+    and:[(bot between:0.0 and:1.0)]]]) ifTrue:[
+	newLayout
 	    leftFraction:left;
 	    rightFraction:right;
 	    topFraction:top;
 	    bottomFraction:bot.
     ] ifFalse:[
-	l
+	newLayout
 	    leftOffset:left;
 	    rightFraction:0 offset:right;
 	    topOffset:top;
 	    bottomFraction:0 offset:bot.
     ].
-    ^ l
+    ^ newLayout
 
     "
      (0.5@0.5 corner:0.75@0.75) asFractionalLayout  
@@ -522,15 +522,15 @@
      are taken from corresponding edges of the receiver.
      You have to make certain that those are in 0..1."
 
-    |l|
+    |newLayout|
 
-    l := LayoutFrame new.
-    l
+    newLayout := LayoutFrame new.
+    newLayout
 	leftOffset:(self left);
 	rightFraction:0 offset:(self right);
 	topOffset:(self top);
 	bottomFraction:0 offset:(self bottom).
-    ^ l
+    ^ newLayout
 
     "
      (0.5@0.5 corner:0.75@0.75) asFractionalLayout 
@@ -1297,5 +1297,5 @@
 !Rectangle class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.34 1996-04-10 19:48:16 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.35 1996-04-10 20:15:20 cg Exp $'
 ! !