Point.st
changeset 5322 411b6c0f7250
parent 5006 8a211e38846d
child 5361 dbf17a65f6bd
--- a/Point.st	Fri Mar 24 12:53:57 2000 +0100
+++ b/Point.st	Fri Mar 24 12:54:44 2000 +0100
@@ -43,16 +43,16 @@
 
     [Instance variables:]
 
-        x              <Number>        the x-coordinate of myself
-        y              <Number>        the y-coordinate of myself
+	x              <Number>        the x-coordinate of myself
+	y              <Number>        the y-coordinate of myself
 
     [author:]
-        Claus Gittinger
+	Claus Gittinger
 
     [see also:]
-        Rectangle Polygon
-        LayoutOrigin LayoutFrame AlignmentOrigin Layout 
-        View GraphicsContext
+	Rectangle Polygon
+	LayoutOrigin LayoutFrame AlignmentOrigin Layout 
+	View GraphicsContext
 "
 ! !
 
@@ -75,7 +75,7 @@
 
     "
      Point
-        decodeFromLiteralArray:#(Point 10 10)
+	decodeFromLiteralArray:#(Point 10 10)
     "
 
     "Created: / 28.1.1998 / 17:44:08 / cg"
@@ -139,22 +139,22 @@
      if no point can be read."
 
     ErrorSignal handle:[:ex |
-        ^ exceptionBlock value
+	^ exceptionBlock value
     ] do:[
-        |str newX newY|
+	|str newX newY|
 
-        str := aStringOrStream readStream.
+	str := aStringOrStream readStream.
 
-        newX := Number readFrom:str onError:nil.
-        newX notNil ifTrue:[
-            (str skipSeparators == $@) ifTrue:[
-                str  next.
-                newY := Number readFrom:str onError:nil.
-                newY notNil ifTrue:[
-                    ^ self x:newX y:newY
-                ]
-            ]
-        ].
+	newX := Number readFrom:str onError:nil.
+	newX notNil ifTrue:[
+	    (str skipSeparators == $@) ifTrue:[
+		str  next.
+		newY := Number readFrom:str onError:nil.
+		newY notNil ifTrue:[
+		    ^ self x:newX y:newY
+		]
+	    ]
+	].
     ].
     ^ exceptionBlock value
 
@@ -176,12 +176,12 @@
     /*
      * claus: I am no longer certain, if this primitive is worth the effort
      */
-    if (__CanDoQuickNew(sizeof(struct __point))) {	/* OBJECT ALLOCATION */
+    if (__CanDoQuickNew(sizeof(struct __Point))) {      /* OBJECT ALLOCATION */
 	if (self == @global(Point)) {
 	    OBJ newPoint;
 	    int spc;
 
-	    __qCheckedAlignedNew(newPoint, sizeof(struct __point));
+	    __qCheckedAlignedNew(newPoint, sizeof(struct __Point));
 	    __InstPtr(newPoint)->o_class = self;
 	    __PointInstPtr(newPoint)->p_x = newX;
 	    __PointInstPtr(newPoint)->p_y = newY;
@@ -305,7 +305,7 @@
 
     p := aPoint asPoint.
     x < (p x) ifTrue:[
-        y < (p y) ifTrue:[^ true].
+	y < (p y) ifTrue:[^ true].
     ].
     ^ false
 
@@ -347,7 +347,7 @@
 
     p := aPoint asPoint.
     (p x) < x ifTrue:[
-        (p y) < y ifTrue:[^ true].
+	(p y) < y ifTrue:[^ true].
     ].
     ^ false
 
@@ -509,9 +509,9 @@
      The encoding is: (Point xValue yValue)"
 
     ^ Array
-        with:#Point 
-        with:x 
-        with:y 
+	with:#Point 
+	with:x 
+	with:y 
 
 
     "
@@ -534,10 +534,10 @@
      consider the case, where a view has a preferred extent of 50@50
      and is to be positioned in its superview which has size 100@100.
      For absolute origin:
-         (10@20) rectangleRelativeTo:(0@0 corner:100@100) preferred:(0@0 corner:50@50) 
+	 (10@20) rectangleRelativeTo:(0@0 corner:100@100) preferred:(0@0 corner:50@50) 
 
      for relative origin:
-         (0.5@0.5) rectangleRelativeTo:(0@0 corner:100@100) preferred:(0@0 corner:50@50) 
+	 (0.5@0.5) rectangleRelativeTo:(0@0 corner:100@100) preferred:(0@0 corner:50@50) 
     "
 
     "Modified: / 27.5.1998 / 10:20:13 / cg"
@@ -843,19 +843,19 @@
     |theta t|
 
     x = 0 ifTrue:[
-        y >= 0 ifTrue:[
-            ^ Float pi * 0.5
-        ].
-        ^ Float pi * 1.5.
+	y >= 0 ifTrue:[
+	    ^ Float pi * 0.5
+	].
+	^ Float pi * 1.5.
     ].
 
     t := y asFloat / x asFloat.
     theta := t arcTan.
     x < 0 ifTrue:[
-        ^ theta +Float pi
+	^ theta +Float pi
     ].
     theta < 0 ifTrue:[
-        ^ theta + (Float pi * 2.0)
+	^ theta + (Float pi * 2.0)
     ].
     ^ theta.
     "
@@ -908,13 +908,13 @@
     "speedup for common cases ..."
 
     (scale isMemberOf:Point) ifTrue:[    
-        ^ Point x:(x * scale x) y:(y * scale y)
+	^ Point x:(x * scale x) y:(y * scale y)
     ].
     (scale isMemberOf:SmallInteger) ifTrue:[
-        ^ Point x:(x * scale) y:(y * scale)
+	^ Point x:(x * scale) y:(y * scale)
     ].
     scale isNumber ifTrue:[
-        ^ Point x:(x * scale) y:(y * scale)
+	^ Point x:(x * scale) y:(y * scale)
     ].
 
     "this is the general (& clean) code ..."
@@ -934,14 +934,14 @@
     "speedup for common cases ..."
 
     (scale isMemberOf:Point) ifTrue:[     
-        ^ Point x:(x + scale x) y:(y + scale y)
+	^ Point x:(x + scale x) y:(y + scale y)
     ].
     (scale isMemberOf:SmallInteger) ifTrue:[
-        "/ same as below, but stc can do better here
-        ^ Point x:(x + scale) y:(y + scale)
+	"/ same as below, but stc can do better here
+	^ Point x:(x + scale) y:(y + scale)
     ].
     scale isNumber ifTrue:[
-        ^ Point x:(x + scale) y:(y + scale)
+	^ Point x:(x + scale) y:(y + scale)
     ].
 
     "this is the general (& clean) code ..."
@@ -961,14 +961,14 @@
     "speedup for common cases ..."
 
     (scale isMemberOf:Point) ifTrue:[     
-        ^ Point x:(x - scale x) y:(y - scale y)
+	^ Point x:(x - scale x) y:(y - scale y)
     ].
     (scale isMemberOf:SmallInteger) ifTrue:[
-        "/ same as below, but stc can do better here
-        ^ Point x:(x - scale) y:(y - scale)
+	"/ same as below, but stc can do better here
+	^ Point x:(x - scale) y:(y - scale)
     ].
     scale isNumber ifTrue:[
-        ^ Point x:(x - scale) y:(y - scale)
+	^ Point x:(x - scale) y:(y - scale)
     ].
 
     "this is the general (& clean) code ..."
@@ -1061,6 +1061,6 @@
 !Point class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Point.st,v 1.53 1999-11-18 20:19:39 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Point.st,v 1.54 2000-03-24 11:54:42 cg Exp $'
 ! !
 Point initialize!