@@ -124,14 +124,15 @@ export class NotebookDiffOverviewRuler extends Themable {
124
124
private _layoutNow ( ) {
125
125
const layoutInfo = this . notebookEditor . getLayoutInfo ( ) ;
126
126
const height = layoutInfo . height ;
127
+ const scrollHeight = layoutInfo . scrollHeight ;
127
128
const ratio = browser . PixelRatio . value ;
128
129
this . _domNode . setWidth ( this . width ) ;
129
130
this . _domNode . setHeight ( height ) ;
130
131
this . _domNode . domNode . width = this . width * ratio ;
131
132
this . _domNode . domNode . height = height * ratio ;
132
133
const ctx = this . _domNode . domNode . getContext ( '2d' ) ! ;
133
134
ctx . clearRect ( 0 , 0 , this . width * ratio , height * ratio ) ;
134
- this . _renderCanvas ( ctx , this . width * ratio , ratio ) ;
135
+ this . _renderCanvas ( ctx , this . width * ratio , height * ratio , scrollHeight * ratio , ratio ) ;
135
136
this . _renderOverviewViewport ( ) ;
136
137
}
137
138
@@ -168,7 +169,7 @@ export class NotebookDiffOverviewRuler extends Themable {
168
169
} ;
169
170
}
170
171
171
- private _renderCanvas ( ctx : CanvasRenderingContext2D , width : number , ratio : number ) {
172
+ private _renderCanvas ( ctx : CanvasRenderingContext2D , width : number , height : number , scrollHeight : number , ratio : number ) {
172
173
if ( ! this . _insertColorHex || ! this . _removeColorHex ) {
173
174
// no op when colors are not yet known
174
175
return ;
@@ -179,7 +180,8 @@ export class NotebookDiffOverviewRuler extends Themable {
179
180
for ( let i = 0 ; i < this . _diffElementViewModels . length ; i ++ ) {
180
181
const element = this . _diffElementViewModels [ i ] ;
181
182
182
- const cellHeight = element . layoutInfo . totalHeight * ratio ;
183
+ const cellHeight = ( element . layoutInfo . totalHeight / scrollHeight ) * ratio * height ;
184
+
183
185
switch ( element . type ) {
184
186
case 'insert' :
185
187
ctx . fillStyle = this . _insertColorHex ;
0 commit comments