Grafoscopio/src/Grafoscopio/GrafoscopioParagraph.class.st

27 lines
863 B
Smalltalk
Raw Normal View History

2020-03-30 17:02:46 +00:00
Class {
#name : #GrafoscopioParagraph,
#superclass : #RubParagraph,
#category : #'Grafoscopio-Rub'
}
2020-04-03 11:08:47 +00:00
{ #category : #'accessing composer' }
GrafoscopioParagraph >> drawOn: aCanvas using: aDisplayScanner at: aPosition [
"Send all visible lines to the displayScanner for display"
| offset leftInRun line visibleRectangle |
self drawingEnabled
ifFalse: [ ^ self ].
visibleRectangle := aCanvas clipRect.
offset := (aPosition - self position) truncated.
leftInRun := 0.
(self lineIndexForPoint: visibleRectangle topLeft) to: (self lineIndexForPoint: visibleRectangle bottomRight) do: [ :i |
line := self lines at: i.
line first <= line last
ifTrue: [ leftInRun := aDisplayScanner displayLine: line offset: offset leftInRun: leftInRun ] ]
]
2020-03-30 17:02:46 +00:00
{ #category : #'accessing composer' }
GrafoscopioParagraph >> newComposer [
^ GrafoscopioComposer new
]