Skip to content

Commit

Permalink
Merge pull request microsoft#233674 from microsoft/tyriar/227102
Browse files Browse the repository at this point in the history
Re-render after canvas device pixel dims change
  • Loading branch information
Tyriar authored and NikolaRHristov committed Nov 19, 2024
2 parents 36613b4 + d000c4b commit bebebe6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Source/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,18 @@ export class ViewLinesGpu extends ViewPart implements IViewLines {

this.canvas = this._viewGpuContext.canvas.domNode;

// Re-render the following frame after canvas device pixel dimensions change, provided a
// new render does not occur.
this._register(autorun(reader => {
/*const dims = */this._viewGpuContext.canvasDevicePixelDimensions.read(reader);
// TODO: Request render, should this just call renderText with the last viewportData
this._viewGpuContext.canvasDevicePixelDimensions.read(reader);
const lastViewportData = this._lastViewportData;
if (lastViewportData) {
setTimeout(() => {
if (lastViewportData === this._lastViewportData) {
this.renderText(lastViewportData);
}
});
}
}));

this.initWebgpu();
Expand Down

0 comments on commit bebebe6

Please sign in to comment.