The Trunk: Graphics-mt.312.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Graphics-mt.312.mcz

commits-2
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.312.mcz

==================== Summary ====================

Name: Graphics-mt.312
Author: mt
Time: 29 April 2015, 5:03:50.235 pm
UUID: ad5f17db-6eed-a44f-a07c-cbfb9d4e09ee
Ancestors: Graphics-mt.311

Some descriptive testing functions added to layout frame. Also extracted calculation of minimum extent to separate methods for allowing layouting algorithms to process them separately and thus avoiding unnecessary calculations.

=============== Diff against Graphics-mt.311 ===============

Item was added:
+ ----- Method: LayoutFrame>>hasFixedHeight (in category 'testing') -----
+ hasFixedHeight
+
+ ^ self topFraction = self bottomFraction!

Item was added:
+ ----- Method: LayoutFrame>>hasFixedWidth (in category 'testing') -----
+ hasFixedWidth
+
+ ^ self leftFraction = self rightFraction!

Item was changed:
  ----- Method: LayoutFrame>>minExtentFrom: (in category 'layout') -----
  minExtentFrom: minExtent
  "Return the minimal extent the given bounds can be represented in"
+ ^ (self minWidthFrom: minExtent x) @ (self minHeightFrom: minExtent y)!
- | width height left right top bottom |
- left := leftFraction ifNil: [0.0].
- right := rightFraction ifNil: [1.0].
- width := left = right
- ifTrue: [0]
- ifFalse: [minExtent x / (right - left)].
- top := topFraction ifNil: [0.0].
- bottom := bottomFraction ifNil: [1.0].
- height := bottom = top
- ifTrue: [0]
- ifFalse: [minExtent y / (bottom - top)].
- leftOffset ifNotNil:[width := width + leftOffset].
- rightOffset ifNotNil:[width := width + rightOffset].
- topOffset ifNotNil:[height := height + topOffset].
- bottomOffset ifNotNil:[height := height + bottomOffset].
- ^width truncated @ height truncated!

Item was added:
+ ----- Method: LayoutFrame>>minHeightFrom: (in category 'layout') -----
+ minHeightFrom: minHeight
+ "Return the minimal extent the given bounds can be represented in"
+ | height top bottom |
+ top := topFraction ifNil: [0.0].
+ bottom := bottomFraction ifNil: [1.0].
+ height := bottom = top
+ ifTrue: [0]
+ ifFalse: [minHeight / (bottom - top)].
+ topOffset ifNotNil:[height := height + topOffset].
+ bottomOffset ifNotNil:[height := height + bottomOffset].
+ ^ height truncated!

Item was added:
+ ----- Method: LayoutFrame>>minWidthFrom: (in category 'layout') -----
+ minWidthFrom: minWidth
+ "Return the minimal extent the given bounds can be represented in"
+ | width left right |
+ left := leftFraction ifNil: [0.0].
+ right := rightFraction ifNil: [1.0].
+ width := left = right
+ ifTrue: [0]
+ ifFalse: [minWidth / (right - left)].
+ leftOffset ifNotNil:[width := width + leftOffset].
+ rightOffset ifNotNil:[width := width + rightOffset].
+ ^width truncated!