[squeak-dev] The Trunk: MorphicTests-nice.12.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Sep 25 19:27:27 UTC 2009


Nicolas Cellier uploaded a new version of MorphicTests to project The Trunk:
http://source.squeak.org/trunk/MorphicTests-nice.12.mcz

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

Name: MorphicTests-nice.12
Author: nice
Time: 25 September 2009, 7:27:25 am
UUID: 8a244a20-058e-7248-8a4c-93af2fa196bd
Ancestors: MorphicTests-rkrk.11

Add a test for http://bugs.squeak.org/view.php?id=1035

Recipe:
1) Add a PolygonMorph in another Morph with a ProportionalLayout.
2) Resize the containing Morph

Result:
the PolygonMorph is lying outside its container...

=============== Diff against MorphicTests-rkrk.11 ===============

Item was added:
+ ----- Method: PolygonMorphTest>>testBoundsBug1035 (in category 'bounds') -----
+ testBoundsBug1035
+ 	"This is a non regression test for http://bugs.squeak.org/view.php?id=1035
+ 	PolygonMorph used to position badly when container bounds were growing"
+ 	
+ 	| submorph aMorph |
+ 	
+ 	submorph := (PolygonMorph
+ 		vertices: {0 at 0. 100 at 0. 0 at 100}
+ 		color: Color red borderWidth: 0 borderColor: Color transparent)
+ 			color: Color red.
+ 
+ 	submorph bounds. "0 at 0 corner: 100 at 100"
+ 
+ 	aMorph := Morph new
+ 		color: Color blue;
+ 		layoutPolicy: ProportionalLayout new;
+ 		addMorph: submorph
+ 		fullFrame: (LayoutFrame fractions: (0.1 @ 0.1 corner: 0.9 @ 0.9)).
+ 
+ 	submorph bounds. "0 at 0 corner: 100 at 100 NOT YET UPDATED"
+ 	aMorph fullBounds. "0 at 0 corner: 50 at 40. CORRECT"
+ 	submorph bounds. "5 at 4 corner: 45 at 36 NOW UPDATED OK"
+ 
+ 	aMorph extent: 100 at 100.
+ 	submorph bounds. "5 at 4 corner: 45 at 36 NOT YET UPDATED"
+ 	aMorph fullBounds. "-10 at -14 corner: 100 at 100 WRONG"
+ 	submorph bounds. "-10 at -14 corner: 70 at 66 NOW WRONG POSITION (BUT RIGHT EXTENT)"
+ 
+ 	self assert: aMorph fullBounds = (0 @ 0 extent: 100 at 100).
+ 	self assert: submorph bounds = (10 @ 10 corner: 90 at 90).
+ !

Item was added:
+ MorphTest subclass: #PolygonMorphTest
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'MorphicTests-Basic'!
+ 
+ !PolygonMorphTest commentStamp: 'nice 2/16/2008 02:13' prior: 0!
+ This class holds tests for PolygonMorph!




More information about the Squeak-dev mailing list