From 8c573b3a5036cb3a7ef8958a24f8f6cc905e184d Mon Sep 17 00:00:00 2001 From: hobbes6-2 Date: Wed, 17 Jun 2026 21:19:14 +0530 Subject: [PATCH 1/6] One possible implementation of image smoothing as a setting. This is global, meaning it adjusts smoothing of ALL images, but inefficient. Other possible approaches are to index through asset library (same outcome) and to add two settings buttons in inspector: enable/disable and apply to all. My opinion is that we should add both options (inspector and global). --- engine/src/ToolSettings.js | 6 +++++- engine/src/view/View.Frame.js | 10 ++++++++++ .../SettingsModal/EditorSettings/EditorSettings.jsx | 7 +++++++ src/Editor/Modals/SettingsModal/SettingsModal.jsx | 1 + 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/engine/src/ToolSettings.js b/engine/src/ToolSettings.js index 597344ca0..dd5b04b43 100644 --- a/engine/src/ToolSettings.js +++ b/engine/src/ToolSettings.js @@ -103,7 +103,11 @@ Wick.ToolSettings = class { type: 'color', name: 'forwardOnionSkinTint', default: new Wick.Color('rgba(0, 0, 255, .5)'), - },{ + }, { + type: "boolean", + name: "imageSmoothing", + default: true + }, { type: "choice", name: 'brushMode', default: 'none', diff --git a/engine/src/view/View.Frame.js b/engine/src/view/View.Frame.js index bb714415a..a21bcf4d7 100644 --- a/engine/src/view/View.Frame.js +++ b/engine/src/view/View.Frame.js @@ -52,6 +52,7 @@ Wick.View.Frame = class extends Wick.View { * Update the view based on the model */ render() { + this.adjustImageSmoothing() this._renderObjects(); } @@ -83,6 +84,15 @@ Wick.View.Frame = class extends Wick.View { this.objectsLayer.addChildren(children); } + adjustImageSmoothing(){ + let bool = this.model.project.toolSettings.getSetting('imageSmoothing'); + this.model.paths.forEach(path => { + if (path.pathType === 'image') { + path.view.item.smoothing = bool; + } + }) + } + _applyDrawableChanges() { this.model.drawable.filter(path => { diff --git a/src/Editor/Modals/SettingsModal/EditorSettings/EditorSettings.jsx b/src/Editor/Modals/SettingsModal/EditorSettings/EditorSettings.jsx index 69054707f..de44091b6 100644 --- a/src/Editor/Modals/SettingsModal/EditorSettings/EditorSettings.jsx +++ b/src/Editor/Modals/SettingsModal/EditorSettings/EditorSettings.jsx @@ -43,6 +43,13 @@ class EditorSettings extends Component { return (
+ + {this.props.setToolSetting('imageSmoothing', bool.target.checked)}} + /> Style: From 1162e09841e9e98e4a2535bce065b1508dafbc75 Mon Sep 17 00:00:00 2001 From: hobbes6-2 Date: Thu, 18 Jun 2026 15:34:13 +0530 Subject: [PATCH 2/6] Different implementation for the global implementation of the smooothing on/off operating. --- engine/src/ToolSettings.js | 9 +++++++++ engine/src/base/Project.js | 1 + engine/src/view/View.Frame.js | 10 ---------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/engine/src/ToolSettings.js b/engine/src/ToolSettings.js index dd5b04b43..91a13c6ef 100644 --- a/engine/src/ToolSettings.js +++ b/engine/src/ToolSettings.js @@ -122,6 +122,8 @@ Wick.ToolSettings = class { this._settings = {}; this._onSettingsChangedCallback = () => {}; + this.project = null + this.resetAllSettings(); this.loadSettingsFromLocalstorage(); } @@ -195,6 +197,13 @@ Wick.ToolSettings = class { } else { localforage.setItem(this.getStorageKey(name), value); } + if (setting.name === "imageSmoothing"){ + this.project.getAssets("Image").forEach(asset => { + asset.getInstances().forEach(img => { + img.view.item.smoothing = setting.value + }) + }) + } } /** diff --git a/engine/src/base/Project.js b/engine/src/base/Project.js index f3c0e3085..1d3925c4f 100644 --- a/engine/src/base/Project.js +++ b/engine/src/base/Project.js @@ -106,6 +106,7 @@ Wick.Project = class extends Wick.Base { this.activeTool = 'cursor'; this._toolSettings = new Wick.ToolSettings(); + this._toolSettings.project = this this._toolSettings.onSettingsChanged((name, value) => { if (name === 'fillColor') { this.selection.fillColor = value.rgba; diff --git a/engine/src/view/View.Frame.js b/engine/src/view/View.Frame.js index a21bcf4d7..bb714415a 100644 --- a/engine/src/view/View.Frame.js +++ b/engine/src/view/View.Frame.js @@ -52,7 +52,6 @@ Wick.View.Frame = class extends Wick.View { * Update the view based on the model */ render() { - this.adjustImageSmoothing() this._renderObjects(); } @@ -84,15 +83,6 @@ Wick.View.Frame = class extends Wick.View { this.objectsLayer.addChildren(children); } - adjustImageSmoothing(){ - let bool = this.model.project.toolSettings.getSetting('imageSmoothing'); - this.model.paths.forEach(path => { - if (path.pathType === 'image') { - path.view.item.smoothing = bool; - } - }) - } - _applyDrawableChanges() { this.model.drawable.filter(path => { From 9fc33bb2ceab16d59646045b85b78891563b6e12 Mon Sep 17 00:00:00 2001 From: hobbes6-2 Date: Mon, 29 Jun 2026 17:05:51 +0530 Subject: [PATCH 3/6] removed asset library thingy and added per-render smoothing reset --- engine/src/ToolSettings.js | 7 ------- engine/src/view/View.Path.js | 4 ++++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/engine/src/ToolSettings.js b/engine/src/ToolSettings.js index 91a13c6ef..4b6c5d73e 100644 --- a/engine/src/ToolSettings.js +++ b/engine/src/ToolSettings.js @@ -197,13 +197,6 @@ Wick.ToolSettings = class { } else { localforage.setItem(this.getStorageKey(name), value); } - if (setting.name === "imageSmoothing"){ - this.project.getAssets("Image").forEach(asset => { - asset.getInstances().forEach(img => { - img.view.item.smoothing = setting.value - }) - }) - } } /** diff --git a/engine/src/view/View.Path.js b/engine/src/view/View.Path.js index 3709a4659..177f16d79 100644 --- a/engine/src/view/View.Path.js +++ b/engine/src/view/View.Path.js @@ -49,6 +49,10 @@ Wick.View.Path = class extends Wick.View { this.importJSON(this.model.json); + if(this.model.pathType == 'image') { + this.item.smoothing = this.model.project.toolSettings.getSetting('imageSmoothing') + }; + // Apply onion skin style if Needed // (This is done here in the Path code because we actually change the style of the path // if the current onion skin mode is set to "outlines" or "tint") From c1ac608266f2c8e84fe64ffbc9f791e71b8415d9 Mon Sep 17 00:00:00 2001 From: hobbsy Date: Sat, 22 Aug 2026 09:02:00 +0530 Subject: [PATCH 4/6] Apply suggestion from @InternetAstronaut Co-authored-by: InternetAstronaut <87543901+InternetAstronaut@users.noreply.github.com> --- engine/src/ToolSettings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/ToolSettings.js b/engine/src/ToolSettings.js index 4b6c5d73e..ffcbc6f5b 100644 --- a/engine/src/ToolSettings.js +++ b/engine/src/ToolSettings.js @@ -118,7 +118,7 @@ Wick.ToolSettings = class { /** * Create a new ToolSettings object. */ - constructor () { + constructor (project) { this._settings = {}; this._onSettingsChangedCallback = () => {}; From b1771ef76834b78019b2bdb68f0735aaabb57c8a Mon Sep 17 00:00:00 2001 From: hobbsy Date: Sat, 22 Aug 2026 09:02:21 +0530 Subject: [PATCH 5/6] Apply suggestion from @InternetAstronaut Co-authored-by: InternetAstronaut <87543901+InternetAstronaut@users.noreply.github.com> --- engine/src/ToolSettings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/ToolSettings.js b/engine/src/ToolSettings.js index ffcbc6f5b..96fa339c2 100644 --- a/engine/src/ToolSettings.js +++ b/engine/src/ToolSettings.js @@ -122,7 +122,7 @@ Wick.ToolSettings = class { this._settings = {}; this._onSettingsChangedCallback = () => {}; - this.project = null + this.project = project || null; this.resetAllSettings(); this.loadSettingsFromLocalstorage(); From 49e00faad8d0585fa1275b1608b5760ab4541ec6 Mon Sep 17 00:00:00 2001 From: hobbes6-2 Date: Sat, 22 Aug 2026 09:29:56 +0530 Subject: [PATCH 6/6] update --- engine/src/base/Path.js | 16 +++++++++------- engine/src/base/Project.js | 3 +-- engine/src/view/View.Path.js | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/engine/src/base/Path.js b/engine/src/base/Path.js index 5bcdde4d3..f30da5abd 100644 --- a/engine/src/base/Path.js +++ b/engine/src/base/Path.js @@ -43,6 +43,14 @@ Wick.Path = class extends Wick.Base { this.json = new paper.Path({ insert: false }).exportJSON({ asString: false }); } + if (this.view.item instanceof paper.TextItem) { + this._pathType = 'text' + } else if (this.view.item instanceof paper.Raster) { + this._pathType = 'image'; + } else { + this._pathType = 'path'; + } + this.needReimport = true; } @@ -133,13 +141,7 @@ Wick.Path = class extends Wick.Base { * @returns {string} */ get pathType() { - if (this.view.item instanceof paper.TextItem) { - return 'text'; - } else if (this.view.item instanceof paper.Raster) { - return 'image'; - } else { - return 'path'; - } + return this._pathType; } /** diff --git a/engine/src/base/Project.js b/engine/src/base/Project.js index 1d3925c4f..113575ac2 100644 --- a/engine/src/base/Project.js +++ b/engine/src/base/Project.js @@ -105,8 +105,7 @@ Wick.Project = class extends Wick.Base { this.activeTool = 'cursor'; - this._toolSettings = new Wick.ToolSettings(); - this._toolSettings.project = this + this._toolSettings = new Wick.ToolSettings(this); this._toolSettings.onSettingsChanged((name, value) => { if (name === 'fillColor') { this.selection.fillColor = value.rgba; diff --git a/engine/src/view/View.Path.js b/engine/src/view/View.Path.js index 177f16d79..c4599f541 100644 --- a/engine/src/view/View.Path.js +++ b/engine/src/view/View.Path.js @@ -50,7 +50,7 @@ Wick.View.Path = class extends Wick.View { this.importJSON(this.model.json); if(this.model.pathType == 'image') { - this.item.smoothing = this.model.project.toolSettings.getSetting('imageSmoothing') + this.item.smoothing = this.model.project.toolSettings.getSetting('imageSmoothing'); }; // Apply onion skin style if Needed