[squeak-dev] The Trunk: MorphicTests-mt.59.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Feb 24 13:03:15 UTC 2020
Marcel Taeumel uploaded a new version of MorphicTests to project The Trunk:
http://source.squeak.org/trunk/MorphicTests-mt.59.mcz
==================== Summary ====================
Name: MorphicTests-mt.59
Author: mt
Time: 24 February 2020, 2:03:14.962031 pm
UUID: a1efbe2f-4b54-e943-a8e3-ec53ce984fc8
Ancestors: MorphicTests-mt.58
Adds a test for #containsPoint: in PolygonMorph. See the discussion on the mailing list: http://forum.world.st/Bug-in-PolygonMorph-gt-gt-filledForm-td5112218.html
=============== Diff against MorphicTests-mt.58 ===============
Item was changed:
+ ----- Method: PolygonMorphTest>>testBoundsBug1035 (in category 'tests') -----
- ----- 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:
+ ----- Method: PolygonMorphTest>>testContainsPoint (in category 'tests') -----
+ testContainsPoint
+ "See http://forum.world.st/Bug-in-PolygonMorph-gt-gt-filledForm-td5112218.html"
+
+ | polygon offset |
+ offset := 100 at 100.
+ polygon := PolygonMorph new
+ borderWidth: 0;
+ setVertices: {0 at 0. 200 at 0. 200 at 200. 0@ 200} + offset;
+ yourself.
+
+ 0 to: polygon width - 1 do: [:x |
+ 0 to: polygon height - 1 do: [:y |
+ self assert: (polygon containsPoint: (x at y) + offset)]].!
More information about the Squeak-dev
mailing list
|