@@ -36,17 +36,17 @@ BrEditor >> beReadOnlyWithoutSelection [
36
36
37
37
{ #category : #accessing }
38
38
BrEditor >> computeVerticalScrollExtent [
39
- ^ self lastVisibleSegment textEnd - self firstVisibleSegment textStart
39
+ ^ self lastVisibleSegment index - self firstVisibleSegment index
40
40
]
41
41
42
42
{ #category : #accessing }
43
43
BrEditor >> computeVerticalScrollOffset [
44
- ^ self firstVisibleSegment textStart
44
+ ^ self firstVisibleSegment index
45
45
]
46
46
47
47
{ #category : #accessing }
48
48
BrEditor >> computeVerticalScrollRange [
49
- ^ self text size
49
+ ^ self text lineCount
50
50
]
51
51
52
52
{ #category : #' editor - accessing' }
@@ -165,12 +165,14 @@ BrEditor >> navigator [
165
165
166
166
{ #category : #' api - scrolling' }
167
167
BrEditor >> onScrollBy: aWish [
168
- | position linesOnScreen |
169
- position := aWish delta y asInteger.
170
- linesOnScreen := self lastVisibleSegment index - self firstVisibleSegment index.
171
- position > self computeVerticalScrollExtent
172
- ifTrue: [ self scrollToPosition: self lastVisibleSegment index + linesOnScreen ]
173
- ifFalse: [ self scrollToPosition: self firstVisibleSegment index - linesOnScreen ]
168
+ | position current |
169
+ position := aWish delta y.
170
+ position := position positive
171
+ ifTrue: [ position roundUpTo: 1 ]
172
+ ifFalse: [ position roundDownTo: 1 ].
173
+ position asBeaconSignal emit.
174
+ current := self firstVisibleSegment index.
175
+ self scrollToPosition: position + current
174
176
]
175
177
176
178
{ #category : #' editor - operations' }
0 commit comments