[squeak-dev] The Trunk: Graphics-ar.73.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Sep 3 15:19:24 UTC 2009


Andreas Raab uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-ar.73.mcz

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

Name: Graphics-ar.73
Author: ar
Time: 3 September 2009, 8:18:38 am
UUID: e416bc79-fd00-7a41-be00-c62fc858d0bf
Ancestors: Graphics-ar.72

Fixes a typo in m17n string display which would measure the width of the entire string instead of just the character.

=============== Diff against Graphics-ar.72 ===============

Item was changed:
  ----- Method: StrikeFont>>displayMultiString:on:from:to:at:kern:baselineY: (in category 'displaying') -----
  displayMultiString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY
  
  	| leftX rightX glyphInfo char destY form gfont destX destPt |
  	destX := aPoint x.
  	charIndex := startIndex.
  	glyphInfo := Array new: 5.
  	startIndex to: stopIndex do:[:charIndex|
  		char := aString at: charIndex.
  		(self hasGlyphOf: char) ifTrue: [
  			self glyphInfoOf: char into: glyphInfo.
  			form := glyphInfo at: 1.
  			leftX := glyphInfo at: 2.
  			rightX := glyphInfo at: 3.
  			destY := glyphInfo at: 4.
  			gfont := glyphInfo at: 5.
  			(gfont == aBitBlt lastFont) ifFalse: [gfont installOn: aBitBlt].
  			destY := baselineY - destY. 
  			aBitBlt displayGlyph: form at: destX @ destY left: leftX right: rightX font: self.
  			destX := destX + (rightX - leftX + kernDelta).
  		] ifFalse:[
  			destPt := self fallbackFont displayString: aString on: aBitBlt from: charIndex to: charIndex at: destX @ aPoint y kern: kernDelta from: self baselineY: baselineY.
  			destPt x = destX ifTrue:[
  				"In some situations BitBlt doesn't return the advance width from the primitive.
  				Work around the situation"
+ 				destX := destX + (self widthOfString: aString from: charIndex to: charIndex) + kernDelta.
- 				destX := destX + (self widthOfString: aString from: startIndex to: stopIndex) + kernDelta.
  			] ifFalse:[destX := destPt x].
  		].
  	].
  	^destX @ aPoint y
  !




More information about the Squeak-dev mailing list