File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/vs/editor/browser/gpu Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ import { GPULifecycle } from './gpuDisposable.js';
19
19
import { ensureNonNullable , observeDevicePixelDimensions } from './gpuUtils.js' ;
20
20
import { RectangleRenderer } from './rectangleRenderer.js' ;
21
21
import type { ViewContext } from '../../common/viewModel/viewContext.js' ;
22
+ import { Event } from '../../../base/common/event.js' ;
23
+ import type { IEditorOptions } from '../../common/config/editorOptions.js' ;
22
24
23
25
const enum GpuRenderLimits {
24
26
maxGpuLines = 3000 ,
@@ -83,6 +85,15 @@ export class ViewGpuContext extends Disposable {
83
85
this . canvas = createFastDomNode ( document . createElement ( 'canvas' ) ) ;
84
86
this . canvas . setClassName ( 'editorCanvas' ) ;
85
87
88
+ // Adjust the canvas size to avoid drawing under the scroll bar
89
+ this . _register ( Event . runAndSubscribe ( configurationService . onDidChangeConfiguration , e => {
90
+ if ( ! e || e . affectsConfiguration ( 'editor.scrollbar.verticalScrollbarSize' ) ) {
91
+ const verticalScrollbarSize = configurationService . getValue < IEditorOptions > ( 'editor' ) . scrollbar ?. verticalScrollbarSize ?? 14 ;
92
+ this . canvas . domNode . style . boxSizing = 'border-box' ;
93
+ this . canvas . domNode . style . paddingRight = `${ verticalScrollbarSize } px` ;
94
+ }
95
+ } ) ) ;
96
+
86
97
this . ctx = ensureNonNullable ( this . canvas . domNode . getContext ( 'webgpu' ) ) ;
87
98
88
99
this . device = GPULifecycle . requestDevice ( ( message ) => {
You can’t perform that action at this time.
0 commit comments