--- a/Spline.st Mon May 13 00:10:32 1996 +0200
+++ b/Spline.st Mon May 13 00:27:49 1996 +0200
@@ -504,6 +504,38 @@
!Spline methodsFor:'queries'!
+bounds
+ "return the smallest enclosing rectangle"
+
+ |minX maxX minY maxY|
+
+ minX := maxX := controlPoints first x.
+ minY := maxY := controlPoints first y.
+ controlPoints do:[:p |
+ |x y|
+
+ (x := p x) < minX ifTrue:[
+ minX := x
+ ] ifFalse:[
+ x > maxX ifTrue:[
+ maxX := x
+ ]
+ ].
+ (y := p y) < minX ifTrue:[
+ minY := y
+ ] ifFalse:[
+ y > maxY ifTrue:[
+ maxY := y
+ ]
+ ].
+ ].
+
+ ^ Rectangle left:minX right:maxX top:minY bottom:maxY
+
+ "Modified: 8.5.1996 / 20:50:03 / cg"
+ "Created: 13.5.1996 / 00:27:29 / cg"
+!
+
isCyclic
"return true, if this spline represents a closed curve"
@@ -515,5 +547,5 @@
!Spline class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Spline.st,v 1.7 1996-05-08 23:09:10 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Spline.st,v 1.8 1996-05-12 22:27:49 cg Exp $'
! !