Skip to content

Commit d197040

Browse files
Fixed performance optimization always enabled.
1 parent e1efb32 commit d197040

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

src/canvas-extensions/canvas-wrapper-data-tagger-canvas-extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import AdvancedCanvasPlugin from "src/main"
44
import SettingsManager, { AdvancedCanvasPluginSettings } from "src/settings"
55

66
const EXPOSED_SETTINGS: (keyof AdvancedCanvasPluginSettings)[] = [
7+
'performanceOptimizationEnabled',
78
'collapsibleGroupsFeatureEnabled',
89
'collapsedGroupPreviewOnDrag'
910
]

src/settings.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export interface AdvancedCanvasPluginSettings {
1313
defaultFileNodeWidth: number
1414
defaultFileNodeHeight: number
1515

16+
performanceOptimizationEnabled: boolean
17+
1618
nodeStylingFeatureEnabled: boolean
1719
shapesFeatureEnabled: boolean
1820
borderStyleFeatureEnabled: boolean
@@ -59,7 +61,11 @@ export const DEFAULT_SETTINGS: Partial<AdvancedCanvasPluginSettings> = {
5961
defaultFileNodeWidth: 400,
6062
defaultFileNodeHeight: 400,
6163

64+
performanceOptimizationEnabled: false,
65+
6266
shapesFeatureEnabled: true,
67+
nodeStylingFeatureEnabled: true,
68+
borderStyleFeatureEnabled: true,
6369

6470
edgesStylingFeatureEnabled: true,
6571
edgeStylePathfinderGridResolution: 10,
@@ -79,9 +85,7 @@ export const DEFAULT_SETTINGS: Partial<AdvancedCanvasPluginSettings> = {
7985
collapsibleGroupsFeatureEnabled: true,
8086
collapsedGroupPreviewOnDrag: true,
8187

82-
nodeStylingFeatureEnabled: true,
8388
stickersFeatureEnabled: true,
84-
borderStyleFeatureEnabled: true,
8589

8690
presentationFeatureEnabled: true,
8791
defaultSlideSize: '1200x675',
@@ -196,6 +200,13 @@ export class AdvancedCanvasPluginSettingTab extends PluginSettingTab {
196200
.onChange(async (value) => await this.settingsManager.setSetting({ defaultFileNodeHeight: Math.max(1, parseInt(value)) }))
197201
)
198202

203+
this.createFeatureHeading(
204+
containerEl,
205+
"Performance optimization",
206+
"Optimize the performance of the canvas (Side effect is some amount of blurriness).",
207+
'performanceOptimizationEnabled'
208+
)
209+
199210
this.createFeatureHeading(
200211
containerEl,
201212
"Node styling",

src/styles/performance.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Source (Slightly modified): https://forum.obsidian.md/t/performance-issue-with-built-in-canvas-plugin/68609/2
22

3-
.view-content:has(> .canvas-wrapper) {
3+
.view-content:has(> .canvas-wrapper[data-performance-optimization-enabled='true']) {
44
overflow: hidden;
55
}
66

7-
.canvas-wrapper {
7+
.canvas-wrapper[data-performance-optimization-enabled='true'] {
88
width: 1000%;
99
height: 1000%;
1010

0 commit comments

Comments
 (0)