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=1035Recipe:
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@0. 100@0. 0@100}
+ color: Color red borderWidth: 0 borderColor: Color transparent)
+ color: Color red.
+
+ submorph bounds. "0@0 corner: 100@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@0 corner: 100@100 NOT YET UPDATED"
+ aMorph fullBounds. "0@0 corner: 50@40. CORRECT"
+ submorph bounds. "5@4 corner: 45@36 NOW UPDATED OK"
+
+ aMorph extent: 100@100.
+ submorph bounds. "5@4 corner: 45@36 NOT YET UPDATED"
+ aMorph fullBounds. "-10@-14 corner: 100@100 WRONG"
+ submorph bounds. "-10@-14 corner: 70@66 NOW WRONG POSITION (BUT RIGHT EXTENT)"
+
+ self assert: aMorph fullBounds = (0 @ 0 extent: 100@100).
+ self assert: submorph bounds = (10 @ 10 corner: 90@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!