[squeak-dev] The Trunk: ST80-mt.278.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Feb 21 15:02:10 UTC 2022


Marcel Taeumel uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-mt.278.mcz

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

Name: ST80-mt.278
Author: mt
Time: 21 February 2022, 4:02:07.924099 pm
UUID: f1296b11-db9c-3640-8b51-270b595554aa
Ancestors: ST80-ct.277

Complements Graphics-mt.483

=============== Diff against ST80-ct.277 ===============

Item was changed:
  ----- Method: CompositionScanner>>composeLine:fromCharacterIndex:inParagraph: (in category '*ST80-Support') -----
  composeLine: lineIndex fromCharacterIndex: startIndex inParagraph: aParagraph 
  	"Answer an instance of TextLineInterval that represents the next line in the paragraph."
+ 	| runLength stopCondition lineSpacing |
- 	| runLength stopCondition |
  	destX := spaceX := leftMargin := aParagraph leftMarginForCompositionForLine: lineIndex.
  	destY := 0.
  	rightMargin := aParagraph rightMarginForComposition.
  	leftMargin >= rightMargin ifTrue: [self error: 'No room between margins to compose'].
  	lastIndex := startIndex.	"scanning sets last index"
+ 	lineHeight := baseline := 0. "Will be increased by setFont"
+ 	lineGap := lineGapSlice := -9999. "Will be increased by setFont; allow negative to show all effects of a custom #extraGap value. See TTFontDescription."
+ 	topMargin := bottomMargin := 0.
- 	lineHeight := baseline := lineGap := lineGapSlice := 0.  "Will be increased by setFont"
  	self setStopConditions.	"also sets font"
  	self handleIndentation.
  	runLength := text runLengthFor: startIndex.
  	runStopIndex := (lastIndex := startIndex) + (runLength - 1).
  	line := TextLineInterval
  		start: lastIndex
  		stop: 0
  		internalSpaces: 0
  		paddingWidth: 0.
  	nextIndexAfterLineBreak := spaceCount := 0.
  	lastBreakIsNotASpace := false.
  	
  	[stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex
  		in: text string rightX: rightMargin.
  	"See setStopConditions for stopping conditions for composing."
  	self perform: stopCondition] whileFalse.
  
+ 	lineHeight := lineHeight + lineGap.
+ 	baseline := baseline + lineGapSlice.
+ 	
+ 	"TODO: Allow special characters or text attributes to accumulate extra top or bottom margin."
+ 	(lineSpacing := textStyle lineSpacing) = 0.0
+ 		ifFalse: [bottomMargin := bottomMargin + (lineSpacing * lineHeight) truncated].
+ 
+ 	line lineHeight: lineHeight baseline: baseline.
+ 	line topMargin: topMargin bottomMargin: bottomMargin.
+ 	
+ 	^ line!
- 	^line
- 		lineHeight: lineHeight + lineGap
- 		baseline: baseline + lineGapSlice!

Item was changed:
  ----- Method: PluggableButtonView>>centerAlignLabelWith: (in category 'private') -----
  centerAlignLabelWith: aPoint
  	"Align the center of the label with aPoint."
  
  	| alignPt |
  	alignPt := label boundingBox center.
  	(label isKindOf: Paragraph) ifTrue: 
+ 		[alignPt := alignPt + (0@(label textStyle defaultFont lineGapSlice))]. 
- 		[alignPt := alignPt + (0@(label textStyle leading))]. 
  	(label isForm)
  	  ifTrue: [label offset: 0 @ 0].
  	label align: alignPt with: aPoint
  !



More information about the Squeak-dev mailing list