The Trunk: Graphics-tpr.229.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-tpr.229.mcz

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

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

Name: Graphics-tpr.229
Author: tpr
Time: 25 September 2013, 2:45:59.809 pm
UUID: 8c04d917-42a3-4c13-a0ae-ad798938e70e
Ancestors: Graphics-tpr.228

improve computeDefaultLineHeight in preparation for later changes.
move multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: up to TextComposer ready to kill MultiTextComposer.

=============== Diff against Graphics-tpr.228 ===============

Item was changed:
  ----- Method: CompositionScanner>>computeDefaultLineHeight (in category 'scanning') -----
  computeDefaultLineHeight
  "Compute the default line height for a potentially empty text"
+ rightMargin notNil
+ ifTrue: [lastIndex := 1.
+ self setFont.
+ ^ lineHeight + textStyle leading]
+ ifFalse: [^textStyle lineGrid]!
- lastIndex := 1.
- self setFont.
- ^lineHeight + textStyle leading!

Item was changed:
  ----- Method: TextComposer>>composeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: (in category 'as yet unclassified') -----
  composeLinesFrom: argStart to: argStop delta: argDelta into: argLinesCollection priorLines: argPriorLines atY: argStartY textStyle: argTextStyle text: argText container: argContainer wantsColumnBreaks: argWantsColumnBreaks
 
  wantsColumnBreaks := argWantsColumnBreaks.
  lines := argLinesCollection.
  theTextStyle := argTextStyle.
  theText := argText.
  theContainer := argContainer.
  deltaCharIndex := argDelta.
  currCharIndex := startCharIndex := argStart.
  stopCharIndex := argStop.
  prevLines := argPriorLines.
  currentY := argStartY.
  maxRightX := theContainer left.
  possibleSlide := stopCharIndex < theText size and: [theContainer isMemberOf: Rectangle].
  nowSliding := false.
  prevIndex := 1.
  scanner := CompositionScanner new text: theText textStyle: theTextStyle.
  scanner wantsColumnBreaks: wantsColumnBreaks.
+ defaultLineHeight := scanner computeDefaultLineHeight.
- defaultLineHeight := scanner canComputeDefaultLineHeight
- ifTrue: [ scanner computeDefaultLineHeight ]
- ifFalse: [ theTextStyle lineGrid. ].
  isFirstLine := true.
  self composeAllLines.
  isFirstLine ifTrue: ["No space in container or empty text"
  self
  addNullLineWithIndex: startCharIndex
  andRectangle: (theContainer topLeft extent: 0@defaultLineHeight)
  ] ifFalse: [
  self fixupLastLineIfCR
  ].
  ^{lines asArray. maxRightX}
 
  !

Item was added:
+ ----- Method: TextComposer>>multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: (in category 'as yet unclassified') -----
+ multiComposeLinesFrom: argStart to: argStop delta: argDelta into: argLinesCollection priorLines: argPriorLines atY: argStartY textStyle: argTextStyle text: argText container: argContainer wantsColumnBreaks: argWantsColumnBreaks
+
+ "temporarily add this here to support move to drop MultiTextComposer"
+ "now redundant and ready to remove later"
+ wantsColumnBreaks := argWantsColumnBreaks.
+ lines := argLinesCollection.
+ theTextStyle := argTextStyle.
+ theText := argText.
+ theContainer := argContainer.
+ deltaCharIndex := argDelta.
+ currCharIndex := startCharIndex := argStart.
+ stopCharIndex := argStop.
+ prevLines := argPriorLines.
+ currentY := argStartY.
+ maxRightX := theContainer left.
+ possibleSlide := stopCharIndex < theText size and: [theContainer isMemberOf: Rectangle].
+ nowSliding := false.
+ prevIndex := 1.
+ scanner := MultiCompositionScanner new text: theText textStyle: theTextStyle.
+ scanner wantsColumnBreaks: wantsColumnBreaks.
+ defaultLineHeight := scanner computeDefaultLineHeight.
+ isFirstLine := true.
+ self composeAllLines.
+ isFirstLine ifTrue: ["No space in container or empty text"
+ self
+ addNullLineWithIndex: startCharIndex
+ andRectangle: (theContainer topLeft extent: 0@defaultLineHeight)
+ ] ifFalse: [
+ self fixupLastLineIfCR
+ ].
+ ^{lines asArray. maxRightX}
+
+ !