Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.244.mcz ==================== Summary ==================== Name: Graphics-nice.244 Author: nice Time: 2 October 2013, 2:27:13.506 pm UUID: a18d7ca3-3796-4a61-ba74-116adf0849ce Ancestors: Graphics-nice.243 Move some CharacterBlockScanner methods used exclusively by MVC in ST80-Support. =============== Diff against Graphics-nice.243 =============== Item was removed: - ----- Method: CharacterBlockScanner>>buildCharacterBlockIn: (in category 'private') ----- - buildCharacterBlockIn: para - "This method is used by the MVC version only." - - | lineIndex runLength lineStop stopCondition | - "handle nullText" - (para numberOfLines = 0 or: [text size = 0]) - ifTrue: [^ CharacterBlock new stringIndex: 1 "like being off end of string" - text: para text - topLeft: (para leftMarginForDisplayForLine: 1 alignment: (alignment ifNil:[textStyle alignment])) - @ para compositionRectangle top - extent: 0 @ textStyle lineGrid]. - "find the line" - lineIndex := para lineIndexOfTop: characterPoint y. - destY := para topAtLineIndex: lineIndex. - line := para lines at: lineIndex. - lastIndex := line first. - rightMargin := para rightMarginForDisplay. - self setStopConditions. " also loads the font, alignment and all emphasis attributes " - - (lineIndex = para numberOfLines and: - [(destY + line lineHeight) < characterPoint y]) - ifTrue: ["if beyond lastLine, force search to last character" - self characterPointSetX: rightMargin] - ifFalse: [characterPoint y < (para compositionRectangle) top - ifTrue: ["force search to first line" - characterPoint := (para compositionRectangle) topLeft]. - characterPoint x > rightMargin - ifTrue: [self characterPointSetX: rightMargin]]. - destX := leftMargin := para leftMarginForDisplayForLine: lineIndex alignment: alignment. - nextLeftMargin:= para leftMarginForDisplayForLine: lineIndex+1 alignment: alignment. - runLength := text runLengthFor: line first. - lineStop := characterIndex "scanning for index" - ifNil: [ line last ]. "scanning for point" - runStopIndex := lastIndex + (runLength - 1) min: lineStop. - lastCharacterWidth := 0. - spaceCount := 0. - self handleIndentation. - - [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex - in: text string rightX: characterPoint x - stopConditions: stopConditions kern: kern. - "see setStopConditions for stopping conditions for character block operations." - self perform: stopCondition] whileFalse. - - ^characterIndex == nil - ifTrue: ["characterBlockAtPoint" - ^ CharacterBlock new stringIndex: lastIndex text: text - topLeft: characterPoint + (font descentKern @ 0) - extent: lastCharacterWidth @ line lineHeight] - ifFalse: ["characterBlockForIndex" - ^ CharacterBlock new stringIndex: lastIndex text: text - topLeft: characterPoint + ((font descentKern) - kern @ 0) - extent: lastCharacterWidth @ line lineHeight]! Item was removed: - ----- Method: CharacterBlockScanner>>characterBlockAtPoint:in: (in category 'scanning') ----- - characterBlockAtPoint: aPoint in: aParagraph - "Answer a CharacterBlock for character in aParagraph at point aPoint. It - is assumed that aPoint has been transformed into coordinates appropriate - to the text's destination form rectangle and the composition rectangle." - - self initializeFromParagraph: aParagraph clippedBy: aParagraph clippingRectangle. - characterPoint := aPoint. - ^self buildCharacterBlockIn: aParagraph! Item was removed: - ----- Method: CharacterBlockScanner>>characterBlockForIndex:in: (in category 'scanning') ----- - characterBlockForIndex: targetIndex in: aParagraph - "Answer a CharacterBlock for character in aParagraph at targetIndex. The - coordinates in the CharacterBlock will be appropriate to the intersection - of the destination form rectangle and the composition rectangle." - - self - initializeFromParagraph: aParagraph - clippedBy: aParagraph clippingRectangle. - characterIndex := targetIndex. - characterPoint := - aParagraph rightMarginForDisplay @ - (aParagraph topAtLineIndex: - (aParagraph lineIndexOfCharacterIndex: characterIndex)). - ^self buildCharacterBlockIn: aParagraph! |
Free forum by Nabble | Edit this page |