"vscode:/vscode.git/clone" did not exist on "c589eae2b83be5206dab7a899738a0995624cc82"
Unverified Commit 23507882 authored by pythongosssss's avatar pythongosssss Committed by GitHub
Browse files

Added open image in new tab menu item

Shifted image down on SaveImage node
parent 8ca346b9
......@@ -264,6 +264,15 @@ function onObjectInfo(json) {
this.addInput(x, type);
}
MyNode.prototype.getExtraMenuOptions = function(graph, options) {
if(this.img) {
options.unshift({
content: "Open Image",
callback: () => window.open(this.img.src, "_blank")
});
}
}
MyNode.prototype.onDrawBackground = function(ctx) {
if(!this.flags.collapsed) {
const output = nodeOutputs[this.id + ""];
......@@ -288,6 +297,10 @@ function onObjectInfo(json) {
let dw = this.size[0];
let dh = this.size[1];
if(this.type === "SaveImage") {
dh -= 55;
}
const scaleX = dw / w;
const scaleY = dh / h;
const scale = Math.min(scaleX, scaleY, 1);
......@@ -298,6 +311,10 @@ function onObjectInfo(json) {
let x = (dw - w) / 2;
let y = (dh - h) / 2;
if(this.type === "SaveImage") {
y += 55;
}
ctx.drawImage(this.img, x, y, w, h);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment