The Trunk: MultilingualTests-tpr.19.mcz

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

The Trunk: MultilingualTests-tpr.19.mcz

commits-2
tim Rowledge uploaded a new version of MultilingualTests to project The Trunk:
http://source.squeak.org/trunk/MultilingualTests-tpr.19.mcz

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

Name: MultilingualTests-tpr.19
Author: tpr
Time: 20 January 2016, 5:59:14.555529 pm
UUID: b2182a04-860d-4137-a68e-89b4502e581d
Ancestors: MultilingualTests-fbs.18

Fix a failing test - when formatting NewParagraphs the caretWidth is added to the width required by the actual included text. The test needs to allow for that

=============== Diff against MultilingualTests-fbs.18 ===============

Item was changed:
  ----- Method: FontTest>>testParagraph (in category 'testing') -----
  testParagraph
  "self debug: #testParagraph"
  | text p style height width |
  text := 'test' asText.
  p := NewParagraph new.
  style := TextStyle default.
  p
  compose: text
  style: style
  from: 1
  in: (0 @ 0 corner: 100 @ 100).
  "See CompositionScanner>>setActualFont: &  
  CompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide:"
  height := style defaultFont height + style leading.
+ width := (text
- width := text
  inject: 0
  into: [:tally :next | tally
+ + (style defaultFont widthOf: next)]) + p caretWidth. "because it is added by the paragraph formatting"
- + (style defaultFont widthOf: next)].
  p adjustRightX.
  self assert: p extent = (width @ height)!