Skip to content
Snippets Groups Projects
Commit cb2b57cc authored by Maximilian Giller's avatar Maximilian Giller
Browse files

Added link rendering to tools

parent a1475eb0
No related branches found
No related tags found
No related merge requests found
......@@ -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) => {
......
......@@ -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);
......
......@@ -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.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment