'From Squeak3.7beta of ''1 April 2004'' [latest update: #5954] on 23 June 2004 at 3:18:15 pm'! "Change Set: NewParagraphComposeFix-nk Date: 23 June 2004 Author: Ned Konz We have had the problem in the past with broken text morphs being distributed in the image. This change set adds a guard in NewParagraph to avoid the problems caused by the (uncommon) case of a paragraph with inconsistent state. " ! !NewParagraph methodsFor: 'fonts-display' stamp: 'nk 3/20/2004 11:13'! displayOn: aCanvas using: displayScanner at: somePosition "Send all visible lines to the displayScanner for display" | visibleRectangle offset leftInRun line | visibleRectangle _ aCanvas clipRect. offset _ (somePosition - positionWhenComposed) truncated. leftInRun _ 0. (self lineIndexForPoint: visibleRectangle topLeft) to: (self lineIndexForPoint: visibleRectangle bottomRight) do: [:i | line _ lines at: i. self displaySelectionInLine: line on: aCanvas. line first <= line last ifTrue: [leftInRun _ displayScanner displayLine: line offset: offset leftInRun: leftInRun]]. ! ! !NewParagraph methodsFor: 'private' stamp: 'nk 6/23/2004 14:50'! moveBy: delta lines do: [:line | line moveBy: delta]. positionWhenComposed _ (positionWhenComposed ifNil: [ container origin ]) + delta. container _ container translateBy: delta! ! !TextOnCurve methodsFor: 'private' stamp: 'nk 6/23/2004 15:06'! moveBy: delta positionWhenComposed _ (positionWhenComposed ifNil: [ container origin ]) + delta. container _ container translateBy: delta ! ! !NewParagraph reorganize! ('access' adjustedFirstCharacterIndex extent firstCharacterIndex focused focused: lastCharacterIndex numberOfLines string text textOwner: textStyle textStyle: wantsColumnBreaks wantsColumnBreaks:) ('alignment' centered justified leftFlush rightFlush) ('composition' OLDcomposeLinesFrom:to:delta:into:priorLines:atY: compose:style:from:in: composeAll composeAllStartingAt: composeLinesFrom:to:delta:into:priorLines:atY: compositionRectangle fixLastWithHeight: recomposeFrom:to:delta: testNewComposeAll) ('copying' deepCopy) ('display' asParagraphForPostscript caretWidth displaySelectionInLine:on: insertionPointColor selectionColor) ('editing' clickAt:for:controller: replaceFrom:to:with:displaying:) ('fonts-display' displayOn:using:at:) ('selection' characterBlockAtPoint: characterBlockForIndex: containsPoint: defaultCharacterBlock selectionRects selectionRectsFrom:to: selectionStart:selectionStop:) ('private' adjustLineIndicesBy: adjustRightX fastFindFirstLineSuchThat: indentationOfLineIndex:ifBlank: lineIndexForCharacter: lineIndexForPoint: lineIndexOfCharacterIndex: lines moveBy: positionWhenComposed: textStyle:lines:text:) !