Grafoscopio/src/Grafoscopio/GrafoscopioParagraph.class.st

51 lines
1.5 KiB
Smalltalk

Class {
#name : #GrafoscopioParagraph,
#superclass : #RubParagraph,
#category : #'Grafoscopio-Rub'
}
{ #category : #'accessing composer' }
GrafoscopioParagraph >> defaultEmptyText [
^ super defaultEmptyText
]
{ #category : #'accessing composer' }
GrafoscopioParagraph >> drawOn: aCanvas using: aDisplayScanner at: aPosition [
"Send all visible lines to the displayScanner for display"
| offset charactersLeft line visibleRectangle return |
self drawingEnabled
ifFalse: [ ^ self ].
visibleRectangle := aCanvas clipRect.
visibleRectangle setPoint: visibleRectangle origin point: visibleRectangle corner x @ 350.
offset := (aPosition - self position) truncated.
charactersLeft := 0.
(self lineIndexForPoint: visibleRectangle topLeft) to: (self lineIndexForPoint: visibleRectangle bottomRight) do: [ :i |
line := self lines at: i.
return := aDisplayScanner displayLine: line offset: offset.
charactersLeft := return second.
]
]
{ #category : #'accessing composer' }
GrafoscopioParagraph >> move: anEvent for: model controller: editor [
self traceCr: 'handle event'
"super move: anEvent for: model controller: editor."
]
{ #category : #'accessing composer' }
GrafoscopioParagraph >> newComposer [
^ GrafoscopioComposer new
]
{ #category : #'accessing composer' }
GrafoscopioParagraph >> uptodateComposer [
^ self composer
text: self text;
textStyle: self textStyle;
container: self compositionRectangle;
emphasisHere: textArea emphasisHere;
cursorWidth: textArea cursorWidth;
yourself
]