checkin from browser
authorClaus Gittinger <cg@exept.de>
Sat, 25 Jan 1997 17:28:47 +0100
changeset 2273 96cc7384fe80
parent 2272 9942d9c853c3
child 2274 891194fa4b17
checkin from browser
Point.st
--- a/Point.st	Sat Jan 25 14:59:27 1997 +0100
+++ b/Point.st	Sat Jan 25 17:28:47 1997 +0100
@@ -17,7 +17,7 @@
 	category:'Graphics-Geometry'
 !
 
-!Point  class methodsFor:'documentation'!
+!Point class methodsFor:'documentation'!
 
 copyright
 "
@@ -56,7 +56,7 @@
 "
 ! !
 
-!Point  class methodsFor:'initialization'!
+!Point class methodsFor:'initialization'!
 
 initialize
     PointZero isNil ifTrue:[
@@ -65,7 +65,7 @@
     ]
 ! !
 
-!Point  class methodsFor:'instance creation'!
+!Point class methodsFor:'instance creation'!
 
 r:distance angle:angle
     "create and return a new point given polar coordinates.
@@ -152,7 +152,7 @@
     ^ (self basicNew) x:newX y:newY
 ! !
 
-!Point  class methodsFor:'constants'!
+!Point class methodsFor:'constants'!
 
 unity
     "return the neutral element for multiplication"
@@ -166,7 +166,7 @@
     ^ PointZero
 ! !
 
-!Point  class methodsFor:'queries'!
+!Point class methodsFor:'queries'!
 
 isBuiltInClass
     "return true if this class is known by the run-time-system.
@@ -781,19 +781,21 @@
     "speedup for common cases ..."
 
     (scale isMemberOf:Point) ifTrue:[    
-	^ (x * scale x) @ (y * scale y)
+        ^ Point x:(x * scale x) y:(y * scale y)
     ].
     (scale isMemberOf:SmallInteger) ifTrue:[
-	^ (x * scale) @ (y * scale)
+        ^ Point x:(x * scale) y:(y * scale)
     ].
     scale isNumber ifTrue:[
-	^ (x * scale) @ (y * scale)
+        ^ Point x:(x * scale) y:(y * scale)
     ].
 
     "this is the general (& clean) code ..."
 
     scalePoint := scale asPoint.
     ^ (x * scalePoint x) @ (y * scalePoint y)
+
+    "Modified: 25.1.1997 / 17:28:11 / cg"
 !
 
 + scale 
@@ -805,19 +807,22 @@
     "speedup for common cases ..."
 
     (scale isMemberOf:Point) ifTrue:[     
-	^ (x + scale x) @ (y + scale y)
+        ^ Point x:(x + scale x) y:(y + scale y)
     ].
     (scale isMemberOf:SmallInteger) ifTrue:[
-	^ (x + scale) @ (y + scale)
+        "/ same as below, but stc can do better here
+        ^ Point x:(x + scale) y:(y + scale)
     ].
     scale isNumber ifTrue:[
-	^ (x + scale) @ (y + scale)
+        ^ Point x:(x + scale) y:(y + scale)
     ].
 
     "this is the general (& clean) code ..."
 
     scalePoint := scale asPoint.
     ^ (x + scalePoint x) @ (y + scalePoint y)
+
+    "Modified: 25.1.1997 / 17:27:46 / cg"
 !
 
 - scale 
@@ -829,19 +834,22 @@
     "speedup for common cases ..."
 
     (scale isMemberOf:Point) ifTrue:[     
-	^ (x - scale x) @ (y - scale y)
+        ^ Point x:(x - scale x) y:(y - scale y)
     ].
     (scale isMemberOf:SmallInteger) ifTrue:[
-	^ (x - scale) @ (y - scale)
+        "/ same as below, but stc can do better here
+        ^ Point x:(x - scale) y:(y - scale)
     ].
     scale isNumber ifTrue:[
-	^ (x - scale) @ (y - scale)
+        ^ Point x:(x - scale) y:(y - scale)
     ].
 
     "this is the general (& clean) code ..."
 
     scalePoint := scale asPoint.
     ^ (x - scalePoint x) @ (y - scalePoint y)
+
+    "Modified: 25.1.1997 / 17:27:40 / cg"
 !
 
 / scale 
@@ -903,9 +911,9 @@
     ^ self + anOffset
 ! !
 
-!Point  class methodsFor:'documentation'!
+!Point class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Point.st,v 1.39 1996-10-08 18:34:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Point.st,v 1.40 1997-01-25 16:28:47 cg Exp $'
 ! !
 Point initialize!