--- a/LayoutOrigin.st Wed Jul 17 10:15:54 2019 +0200
+++ b/LayoutOrigin.st Wed Jul 17 10:16:05 2019 +0200
@@ -276,6 +276,47 @@
^ leftFraction hash + topFraction hash + leftOffset hash + topOffset hash
! !
+!LayoutOrigin methodsFor:'computing'!
+
+rectangleRelativeTo:superRectangle preferred:prefRectHolder
+ "compute the rectangle represented by the receiver,
+ given the superView's rectangle and the view's preferredExtent."
+
+ |x y prefRect|
+
+ prefRect := prefRectHolder value.
+
+ x := superRectangle left.
+ y := superRectangle top.
+
+ leftOffset notNil ifTrue:[
+ x := x + leftOffset value
+ ].
+ topOffset notNil ifTrue:[
+ y := y + topOffset value
+ ].
+ leftFraction notNil ifTrue:[
+ x := x + (superRectangle width * leftFraction value)
+ ].
+ topFraction notNil ifTrue:[
+ y := y + (superRectangle height * topFraction value)
+ ].
+ ^ Rectangle left:x top:y extent:prefRect extent
+
+ "
+ |superRect lO|
+
+ superRect := 0@0 corner:100@100.
+ lO := (LayoutOrigin new).
+ lO leftFraction:0.5;
+ topFraction:0.5.
+ lO rectangleRelativeTo:superRect preferred:(0@0 corner:30@30)
+ "
+
+ "Modified: / 13-08-1998 / 18:39:49 / cg"
+ "Modified (comment): / 17-07-2019 / 10:02:59 / Claus Gittinger"
+! !
+
!LayoutOrigin methodsFor:'converting'!
asAlignmentOrigin
@@ -379,44 +420,6 @@
origin
^ leftFraction asFloat @ topFraction asFloat
-!
-
-rectangleRelativeTo:superRectangle preferred:prefRectHolder
- "compute the rectangle represented by the receiver,
- given the superViews rectangle and the view's preferredExtent."
-
- |x y prefRect|
-
- prefRect := prefRectHolder value.
-
- x := superRectangle left.
- y := superRectangle top.
-
- leftOffset notNil ifTrue:[
- x := x + leftOffset value
- ].
- topOffset notNil ifTrue:[
- y := y + topOffset value
- ].
- leftFraction notNil ifTrue:[
- x := x + (superRectangle width * leftFraction value)
- ].
- topFraction notNil ifTrue:[
- y := y + (superRectangle height * topFraction value)
- ].
- ^ Rectangle left:x top:y extent:prefRect extent
-
- "
- |superRect lO|
-
- superRect := 0@0 corner:100@100.
- lO := (LayoutOrigin new).
- lO leftFraction:0.5;
- topFraction:0.5.
- lO rectangleRelativeTo:superRect preferred:(0@0 corner:30@30)
- "
-
- "Modified: / 13.8.1998 / 18:39:49 / cg"
! !
!LayoutOrigin class methodsFor:'documentation'!