MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / handleResize

Method handleResize

src/plotViewer/index.ts:552–568  ·  view source on GitHub ↗
(height: number, width: number, userTriggered: boolean = false)

Source from the content-addressed store, hash-verified

550 }
551
552 protected handleResize(height: number, width: number, userTriggered: boolean = false): void {
553 this.viewHeight = height;
554 this.viewWidth = width;
555 if (userTriggered || this.resizeTimeoutLength === 0) {
556 if(this.resizeTimeout){
557 clearTimeout(this.resizeTimeout);
558 }
559 this.resizeTimeout = undefined;
560 void this.resizePlot();
561 } else if (!this.resizeTimeout) {
562 this.resizeTimeout = setTimeout(() => {
563 void this.resizePlot().then(() =>
564 this.resizeTimeout = undefined
565 );
566 }, this.resizeTimeoutLength);
567 }
568 }
569
570 protected async resizePlot(id?: HttpgdPlotId): Promise<void> {
571 id ??= this.activePlot;

Callers 1

handleWebviewMessageMethod · 0.95

Calls 1

resizePlotMethod · 0.95

Tested by

no test coverage detected