--- a/Geometric.st Tue Oct 02 11:58:53 2001 +0200
+++ b/Geometric.st Tue Oct 02 13:27:42 2001 +0200
@@ -339,6 +339,16 @@
].
^ self shouldNotImplement
+ "
+ |v r|
+
+ v := View new.
+ v extent:200@200.
+ v openAndWait.
+ r := Rectangle origin:10@10 corner:100@100.
+ r asFiller displayOn:v.
+ "
+
"Modified: 12.2.1997 / 11:47:22 / cg"
!
@@ -376,6 +386,16 @@
^ self subclassResponsibility
+ "
+ |v r|
+
+ v := View new.
+ v extent:200@200.
+ v openAndWait.
+ r := Rectangle origin:10@10 corner:100@100.
+ r displayFilledOn:v.
+ "
+
"Modified: 8.5.1996 / 09:07:02 / cg"
!
@@ -384,6 +404,16 @@
attributes are used. The default here is to display the outline."
^ self displayStrokedOn:aGC
+
+ "
+ |v r|
+
+ v := View new.
+ v extent:200@200.
+ v openAndWait.
+ r := Rectangle origin:10@10 corner:100@100.
+ r displayOn:v.
+ "
!
displayStrokedOn:aGC
@@ -485,6 +515,6 @@
!Geometric class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Geometric.st,v 1.26 2000-08-31 10:02:48 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Geometric.st,v 1.27 2001-10-02 11:27:42 cg Exp $'
! !
Geometric initialize!
--- a/Rectangle.st Tue Oct 02 11:58:53 2001 +0200
+++ b/Rectangle.st Tue Oct 02 13:27:42 2001 +0200
@@ -286,16 +286,19 @@
!Rectangle methodsFor:'Compatibility - Squeak'!
amountToTranslateWithin: aRectangle
- "Answer a Point, delta, such that self + delta is forced within aRectangle."
- "Altered so as to prefer to keep self topLeft inside when all of self
- cannot be made to fit 7/27/96 di"
- | dx dy |
- dx _ 0. dy _ 0.
- self right > aRectangle right ifTrue: [dx _ aRectangle right - self right].
- self bottom > aRectangle bottom ifTrue: [dy _ aRectangle bottom - self bottom].
- (self left + dx) < aRectangle left ifTrue: [dx _ aRectangle left - self left].
- (self top + dy) < aRectangle top ifTrue: [dy _ aRectangle top - self top].
- ^ dx@dy!
+ "Answer a Point, delta, such that self + delta is forced within aRectangle."
+ "Altered so as to prefer to keep self topLeft inside when all of self
+ cannot be made to fit 7/27/96 di"
+
+ | dx dy |
+
+ dx := 0. dy := 0.
+ self right > aRectangle right ifTrue: [dx := aRectangle right - self right].
+ self bottom > aRectangle bottom ifTrue: [dy := aRectangle bottom - self bottom].
+ (self left + dx) < aRectangle left ifTrue: [dx := aRectangle left - self left].
+ (self top + dy) < aRectangle top ifTrue: [dy := aRectangle top - self top].
+ ^ dx@dy
+!
containsRect:aRect
"Answer whether aRect is within the receiver (OK to coincide)."
@@ -316,9 +319,10 @@
!
translatedToBeWithin: aRectangle
- "Answer a copy of the receiver that does not extend beyond aRectangle. 7/8/96 sw"
+ "Answer a copy of the receiver that does not extend beyond aRectangle. 7/8/96 sw"
- ^ self translateBy: (self amountToTranslateWithin: aRectangle)!
+ ^ self translateBy: (self amountToTranslateWithin: aRectangle)
+!
withHeight:height
"Return a copy of me with a different height"
@@ -1760,5 +1764,5 @@
!Rectangle class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.72 2000-08-21 22:45:11 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.73 2001-10-02 11:27:33 cg Exp $'
! !