fixed bug in getInputNode

This commit is contained in:
tamat
2018-10-16 13:50:42 +02:00
parent c24277e0c4
commit ffa9e24f90
2 changed files with 30 additions and 14 deletions

View File

@@ -463,7 +463,7 @@ function MathOperation()
this.addOutput("=","number");
this.addProperty( "A", 1 );
this.addProperty( "B", 1 );
this.addProperty( "OP", "+", "string", { values: MathOperation.values } );
this.addProperty( "OP", "+", "enum", { values: MathOperation.values } );
}
MathOperation.values = ["+","-","*","/","%","^"];
@@ -472,6 +472,10 @@ MathOperation.title = "Operation";
MathOperation.desc = "Easy math operators";
MathOperation["@OP"] = { type:"enum", title: "operation", values: MathOperation.values };
MathOperation.prototype.getTitle = function()
{
return "A " + this.properties.OP + " B";
}
MathOperation.prototype.setValue = function(v)
{
@@ -516,9 +520,9 @@ MathOperation.prototype.onDrawBackground = function(ctx)
return;
ctx.font = "40px Arial";
ctx.fillStyle = "black";
ctx.fillStyle = "#CCC";
ctx.textAlign = "center";
ctx.fillText(this.properties.OP, this.size[0] * 0.5, this.size[1] * 0.5 + LiteGraph.NODE_TITLE_HEIGHT );
ctx.fillText(this.properties.OP, this.size[0] * 0.5, this.size[1] * 0.35 + LiteGraph.NODE_TITLE_HEIGHT );
ctx.textAlign = "left";
}