[squeak-dev] The Trunk: Morphic-ar.200.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Oct 6 04:13:01 UTC 2009


Andreas Raab uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ar.200.mcz

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

Name: Morphic-ar.200
Author: ar
Time: 5 October 2009, 9:11:34 am
UUID: 9898c530-f7d1-e040-bea8-8afd49d06c12
Ancestors: Morphic-nice.199, Morphic-ml.197

Merging Morphic-ml.197:

Avoid division by 0 if width or height degenerate to 0 in LayoutFrame>>minExtentFrom:

=============== Diff against Morphic-nice.199 ===============

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




More information about the Squeak-dev mailing list