[squeak-dev] The Trunk: Graphics-nice.196.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jan 15 01:16:37 UTC 2013


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

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

Name: Graphics-nice.196
Author: nice
Time: 15 January 2013, 2:15:42.347 am
UUID: bb016276-f7e3-44ac-af5a-f6dba9b98940
Ancestors: Graphics-bf.195

Some degenerated rectangles (lines) can intersects: even though they have a null area.

=============== Diff against Graphics-bf.195 ===============

Item was changed:
  ----- Method: Rectangle>>intersects: (in category 'testing') -----
  intersects: aRectangle 
  	"Answer whether aRectangle intersects the receiver anywhere."
  	"Optimized; old code answered:
  		(origin max: aRectangle origin) < (corner min: aRectangle corner)"
  
  	| rOrigin rCorner |
  	rOrigin := aRectangle origin.
  	rCorner := aRectangle corner.
  	rCorner x <= origin x	ifTrue: [^ false].
  	rCorner y <= origin y	ifTrue: [^ false].
  	rOrigin x >= corner x	ifTrue: [^ false].
  	rOrigin y >= corner y	ifTrue: [^ false].
  "None of the two rectangle shall be empty"
+ 	corner x < origin x	ifTrue: [^ false].
+ 	corner y < origin y	ifTrue: [^ false].
+ 	rCorner x < rOrigin x	ifTrue: [^ false].
+ 	rCorner y < rOrigin y	ifTrue: [^ false].
- 	corner x <= origin x	ifTrue: [^ false].
- 	corner y <= origin y	ifTrue: [^ false].
- 	rCorner x <= rOrigin x	ifTrue: [^ false].
- 	rCorner y <= rOrigin y	ifTrue: [^ false].
  	^ true
  !



More information about the Squeak-dev mailing list