[squeak-dev] The Trunk: GraphicsTests-wiz.23.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Apr 29 22:47:15 UTC 2010


A new version of GraphicsTests was added to project The Trunk:
http://source.squeak.org/trunk/GraphicsTests-wiz.23.mcz

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

Name: GraphicsTests-wiz.23
Author: wiz
Time: 29 April 2010, 2:18:35.461 am
UUID: 98625695-e54f-407f-b627-a90e6d5dfa80
Ancestors: GraphicsTests-ar.22

This adds a test demonstrating that rectangles will change shape when their dimensions are rounded if the origin and corner are in different quadrants.

See Mantis 2453
http://bugs.squeak.org/view.php?id=2453

The condition for this to happen occurs anytime a morph with odd extent is rendered by a transformation morph.

Yours in curiosity and service, --Jerome Peace

=============== Diff against GraphicsTests-ar.22 ===============

Item was added:
+ ----- Method: RectangleTest>>testRoundingAfterHalfPixelTranslation (in category 'tests') -----
+ testRoundingAfterHalfPixelTranslation
+ 	"A rectangle right on the cusp of rounding changes shape if origin and
+ 	corner are in differenct quadrants"
+ 	"self debug: #testRoundingAfterHalfPixelTranslation"
+ 	| trouble noTrouble |
+ 	trouble := 10 negated asPoint rect: 10 asPoint.
+ 	noTrouble := trouble translateBy: 15.
+ 	
+ 	10 timesRepeat: [trouble := (trouble translateBy: 0.5) rounded].
+ 	10 timesRepeat: [noTrouble := (noTrouble translateBy: 0.5) rounded].
+ 	
+ 	self assert: trouble extent = noTrouble extent!




More information about the Squeak-dev mailing list