diff --git a/editor/js/editor.js b/editor/js/editor.js index 8473bf1e54744105bda4bd90c035242a024c16b5..74e3e3d7effac9fd399bba82b24360ebf6732c55 100644 --- a/editor/js/editor.js +++ b/editor/js/editor.js @@ -65,6 +65,8 @@ function load() { ) .nodeCanvasObjectMode((node) => state.nodeCanvasObjectMode(node)) .nodeCanvasObject((node, ctx, globalScale) => state.nodeCanvasObject(node, ctx, globalScale)) + .linkCanvasObjectMode((link) => state.linkCanvasObjectMode(link)) + .linkCanvasObject((link, ctx, globalScale) => state.linkCanvasObject(link, ctx, globalScale)) .onLinkClick((link) => state.onLinkClick(link)); graph.onChangeCallbacks.push((data) => { diff --git a/editor/js/state.js b/editor/js/state.js index cbf44c4cf38a0b1822215103f512744f78992e3d..2066357f58906911bf2e33ec7845b8061e9ff0cd 100644 --- a/editor/js/state.js +++ b/editor/js/state.js @@ -198,6 +198,26 @@ export class State extends Tool { return "after"; } + linkCanvasObjectMode(link) { + var toolValue = this.tool.linkCanvasObjectMode(link); + + if (toolValue !== undefined) { + return toolValue; + } + + return "after"; + } + + linkCanvasObject(link, ctx, globalScale) { + var toolValue = this.tool.linkCanvasObject(link, ctx); + + if (toolValue !== undefined) { + return toolValue; + } + + return undefined; + } + linkWidth(link) { var toolValue = this.tool.linkWidth(link); diff --git a/editor/js/tools/tool.js b/editor/js/tools/tool.js index 0c7b3ad8fca720d14580e416fc1283a690790da7..63ab11725ff252d56e49ab12499e36888643c6a6 100644 --- a/editor/js/tools/tool.js +++ b/editor/js/tools/tool.js @@ -93,6 +93,18 @@ export default class Tool { } } + linkCanvasObject(link, ctx, globalScale) { + if (this.warnings) { + console.warn('Method "linkCanvasObject" not implemented.'); + } + } + + linkCanvasObjectMode(link) { + if (this.warnings) { + console.warn('Method "linkCanvasObjectMode" not implemented.'); + } + } + nodePointerAreaPaint(node, color, ctx) { if (this.warnings) { console.warn('Method "nodePointerAreaPaint" not implemented.');