The Trunk: Graphics-nice.93.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Graphics-nice.93.mcz

commits-2
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.
- !