Skip to content

Commit

Permalink
Adds config option 'zoomWheel'
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Bachmann committed May 28, 2024
1 parent 716eb7d commit a0f95ff
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,12 @@
"title": "Draw.io zoom factor",
"description": "Defines the zoom factor for mouse wheel and trackpad zoom."
},
"hediet.vscode-drawio.zoomWheel": {
"type": "boolean",
"default": false,
"title": "Draw.io zoom wheel option",
"description": "Defines whether zoom is possible without meta key, i.e. only using mouse wheel without Ctrl/Alt/Cmd."
},
"hediet.vscode-drawio.globalVars": {
"type": "object",
"title": "Draw.io global variables.",
Expand Down
17 changes: 17 additions & 0 deletions src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,23 @@ export class DiagramConfig {

// #endregion

// #region Zoom Wheel

private readonly _zoomWheel = new VsCodeSetting<boolean>(
`${extensionId}.zoomWheel`,
{
scope: this.uri,
serializer: serializerWithDefault<boolean>(false),
}
);

@computed
public get zoomWheel(): boolean {
return this._zoomWheel.get();
}

// #endregion

// #region Global Variables

private readonly _globalVars = new VsCodeSetting<object | null>(
Expand Down
1 change: 1 addition & 0 deletions src/DrawioClient/DrawioClientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export class DrawioClientFactory {
defaultLibraries: "general",
libraries: simpleDrawioLibrary(libs),
zoomFactor: config.zoomFactor,
zoomWheel: config.zoomWheel,
globalVars: config.globalVars,
};
},
Expand Down

0 comments on commit a0f95ff

Please sign in to comment.