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

commits at source.squeak.org commits at source.squeak.org
Fri Dec 25 23:54:46 UTC 2009


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

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

Name: Graphics-nice.93
Author: nice
Time: 26 December 2009, 12:54:09 pm
UUID: 4afc6596-c8e0-49d7-8dad-188a43b18fcc
Ancestors: Graphics-ul.92

Simplify redundant definitions of widthOfString:from:to:

=============== Diff against Graphics-ul.92 ===============

Item was changed:
  ----- Method: AbstractFont>>widthOfString:from:to: (in category 'measuring') -----
  widthOfString: aString from: startIndex to: stopIndex
  	"Measure the length of the given string between start and stop index"
+ 	| resultX |
- 	| character resultX |
  	resultX := 0.
+ 	startIndex to: stopIndex do: [:i | 
+ 		resultX := resultX + (self widthOf: (aString at: i))].
- 	startIndex to: stopIndex do:[:i | 
- 		character := aString at: i.
- 		resultX := resultX + (self widthOf: character)].
  	^resultX!

Item was removed:
- ----- Method: HostFont>>widthOfString:from:to: (in category 'accessing') -----
- widthOfString: aString from: firstIndex to: lastIndex
- 	
- 	^ (aString copyFrom: firstIndex to: lastIndex) inject: 0 into: [:s :t | s := s + (self widthOf: t)].!

Item was removed:
- ----- Method: StrikeFont>>widthOfString:from:to: (in category 'displaying') -----
- widthOfString: aString from: firstIndex to: lastIndex
- 	| resultX |
- 	resultX := 0.
- 	firstIndex to: lastIndex do:[:i | 
- 		resultX := resultX + (self widthOf: (aString at: i))].
- 	^ resultX.
- !




More information about the Squeak-dev mailing list