Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.249.mcz ==================== Summary ==================== Name: Graphics-nice.249 Author: nice Time: 4 October 2013, 10:19:18.659 pm UUID: d13115d9-7d8d-4689-8114-d8d00741f7c0 Ancestors: Graphics-nice.248 Move TextLineInterval from Graphics to ST80-Support =============== Diff against Graphics-nice.248 =============== Item was removed: - Interval subclass: #TextLineInterval - instanceVariableNames: 'internalSpaces paddingWidth lineHeight baseline' - classVariableNames: '' - poolDictionaries: 'TextConstants' - category: 'Graphics-Text'! - - !TextLineInterval commentStamp: '<historical>' prior: 0! - My instances specify the starting and stopping points in a String of a composed line. The step is always 1.! Item was removed: - ----- Method: TextLineInterval class>>start:stop:internalSpaces:paddingWidth: (in category 'instance creation') ----- - start: startInteger stop: stopInteger internalSpaces: spacesInteger paddingWidth: padWidthInteger - "Answer an instance of me with the arguments as the start, stop points, - number of spaces in the line, and width of the padding." - | newSelf | - newSelf := super from: startInteger to: stopInteger by: 1. - ^newSelf internalSpaces: spacesInteger paddingWidth: padWidthInteger! Item was removed: - ----- Method: TextLineInterval>>= (in category 'comparing') ----- - = line - - self species = line species - ifTrue: [^((start = line first and: [stop = line last]) - and: [internalSpaces = line internalSpaces]) - and: [paddingWidth = line paddingWidth]] - ifFalse: [^false]! Item was removed: - ----- Method: TextLineInterval>>baseline (in category 'accessing') ----- - baseline - ^ baseline! Item was removed: - ----- Method: TextLineInterval>>internalSpaces (in category 'accessing') ----- - internalSpaces - "Answer the number of spaces in the line." - - ^internalSpaces! Item was removed: - ----- Method: TextLineInterval>>internalSpaces: (in category 'accessing') ----- - internalSpaces: spacesInteger - "Set the number of spaces in the line to be spacesInteger." - - internalSpaces := spacesInteger! Item was removed: - ----- Method: TextLineInterval>>internalSpaces:paddingWidth: (in category 'private') ----- - internalSpaces: spacesInteger paddingWidth: padWidthInteger - - internalSpaces := spacesInteger. - paddingWidth := padWidthInteger! Item was removed: - ----- Method: TextLineInterval>>justifiedPadFor: (in category 'scanning') ----- - justifiedPadFor: spaceIndex - "Compute the width of pad for a given space in a line of justified text." - - | pad | - internalSpaces = 0 ifTrue: [^0]. - pad := paddingWidth // internalSpaces. - spaceIndex <= (paddingWidth \\ internalSpaces) - ifTrue: [^pad + 1] - ifFalse: [^pad]! Item was removed: - ----- Method: TextLineInterval>>justifiedPadFor:font: (in category 'scanning') ----- - justifiedPadFor: spaceIndex font: aFont - "Compute the width of pad for a given space in a line of justified text." - - | pad | - internalSpaces = 0 ifTrue: [^0]. - ^(aFont notNil and:[aFont isSubPixelPositioned]) - ifTrue:[paddingWidth * 1.0 / internalSpaces] - ifFalse:[ - pad := paddingWidth // internalSpaces. - spaceIndex <= (paddingWidth \\ internalSpaces) - ifTrue: [pad + 1] - ifFalse: [pad]]! Item was removed: - ----- Method: TextLineInterval>>justifiedTabDeltaFor: (in category 'scanning') ----- - justifiedTabDeltaFor: spaceIndex - "Compute the delta for a tab in a line of justified text, so tab falls - somewhere plausible when line is justified." - - | pad extraPad | - internalSpaces = 0 ifTrue: [^0]. - pad := paddingWidth // internalSpaces. - extraPad := paddingWidth \\ internalSpaces. - spaceIndex <= extraPad - ifTrue: [^spaceIndex * (pad + 1)] - ifFalse: [^extraPad * (pad + 1) + (spaceIndex - extraPad * pad)]! Item was removed: - ----- Method: TextLineInterval>>lineHeight (in category 'accessing') ----- - lineHeight - ^ lineHeight! Item was removed: - ----- Method: TextLineInterval>>lineHeight:baseline: (in category 'private') ----- - lineHeight: height baseline: ascent - - lineHeight := height. - baseline := ascent! Item was removed: - ----- Method: TextLineInterval>>paddingWidth (in category 'accessing') ----- - paddingWidth - "Answer the amount of space to be added to the font." - - ^paddingWidth! Item was removed: - ----- Method: TextLineInterval>>paddingWidth: (in category 'accessing') ----- - paddingWidth: padWidthInteger - "Set the amount of space to be added to the font to be padWidthInteger." - - paddingWidth := padWidthInteger! Item was removed: - ----- Method: TextLineInterval>>slide: (in category 'updating') ----- - slide: delta - "Change the starting and stopping points of the line by delta." - - start := start + delta. - stop := stop + delta! Item was removed: - ----- Method: TextLineInterval>>stop: (in category 'accessing') ----- - stop: stopInteger - "Set the stopping point in the string of the line to be stopInteger." - - stop := stopInteger! |
Free forum by Nabble | Edit this page |