MCPcopy
hub / github.com/wavetermdev/waveterm / setZoomFactor

Method setZoomFactor

frontend/app/view/webview/webview.tsx:590–607  ·  view source on GitHub ↗
(factor: number | null)

Source from the content-addressed store, hash-verified

588 }
589
590 setZoomFactor(factor: number | null) {
591 // null is ok (will reset to default)
592 if (factor != null && factor < 0.1) {
593 factor = 0.1;
594 }
595 if (factor != null && factor > 5) {
596 factor = 5;
597 }
598 const domReady = globalStore.get(this.domReady);
599 if (!domReady) {
600 return;
601 }
602 this.webviewRef.current?.setZoomFactor(factor || 1);
603 this.env.rpc.SetMetaCommand(TabRpcClient, {
604 oref: makeORef("block", this.blockId),
605 meta: { "web:zoom": factor }, // allow null so we can remove the zoom factor here
606 });
607 }
608
609 getSettingsMenuItems(): ContextMenuItem[] {
610 const zoomSubMenu: ContextMenuItem[] = [];

Callers 6

getSettingsMenuItemsMethod · 0.95
increaseZoomLevelFunction · 0.45
decreaseZoomLevelFunction · 0.45
resetZoomLevelFunction · 0.45
webview.tsxFile · 0.45

Calls 3

makeORefFunction · 0.90
getMethod · 0.80
SetMetaCommandMethod · 0.65

Tested by

no test coverage detected