From 6de8b337690ec1bc6bcd76ebb8c41908d8790798 Mon Sep 17 00:00:00 2001 From: sakazuki Date: Sun, 2 Dec 2018 14:27:48 +0900 Subject: [PATCH] fix typo --- editor/js/ui/palette.js | 2 +- editor/js/ui/userSettings.js | 2 +- editor/js/ui/view.js | 30 +++++++++++++++--------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/editor/js/ui/palette.js b/editor/js/ui/palette.js index 0a1804f04..d647a086f 100644 --- a/editor/js/ui/palette.js +++ b/editor/js/ui/palette.js @@ -105,7 +105,7 @@ RED.palette = (function() { var labelElement = el.find(".palette_label"); labelElement.html(lines).attr('dir', RED.text.bidi.resolveBaseTextDir(lines)); - if (RED.view.virtical()) { + if (RED.view.vertical()) { el.find(".palette_port").css({top:(multiLineNodeHeight/2-5)+"px", left: "55px"}); el.find(".palette_port_output").css({top:(multiLineNodeHeight-5)+"px", right: "55px"}); el.find(".palette_port_input").css({top: "-5px"}); diff --git a/editor/js/ui/userSettings.js b/editor/js/ui/userSettings.js index d7459e263..ae54bf09d 100644 --- a/editor/js/ui/userSettings.js +++ b/editor/js/ui/userSettings.js @@ -121,7 +121,7 @@ RED.userSettings = (function() { title: "menu.label.other", options: [ {setting:"view-show-tips",oldSettings:"menu-menu-item-show-tips",label:"menu.label.showTips",toggle:true,default:true,onchange:"core:toggle-show-tips"}, - {setting:"view-flow-virtical",label:"menu.label.view.flowVirtical",toggle:true,default:true,onchange:RED.view.virtical} + {setting:"view-flow-vertical",label:"menu.label.view.flowVirtical",toggle:true,default:true,onchange:RED.view.vertical} ] } ]; diff --git a/editor/js/ui/view.js b/editor/js/ui/view.js index 32e324bf9..4f399faff 100644 --- a/editor/js/ui/view.js +++ b/editor/js/ui/view.js @@ -33,7 +33,7 @@ RED.view = (function() { var gridSize = 20; var snapGrid = false; - var virtical = false; + var vertical = false; var activeSpliceLink; var spliceActive = false; @@ -660,7 +660,7 @@ RED.view = (function() { nn.changed = true; nn.moved = true; - if (virtical) { + if (vertical) { nn.w = Math.max(node_width,(nn.outputs||0) * 15); nn.h = node_height; }else{ @@ -941,14 +941,14 @@ RED.view = (function() { var drag_line = drag_lines[i]; var numOutputs = (drag_line.portType === PORT_TYPE_OUTPUT)?(drag_line.node.outputs || 1):1; var sourcePort = drag_line.port; - if (virtical) { + if (vertical) { var portX = -((numOutputs-1)/2)*13 +13*sourcePort; }else{ var portY = -((numOutputs-1)/2)*13 +13*sourcePort; } var sc = (drag_line.portType === PORT_TYPE_OUTPUT)?1:-1; - if (virtical) { + if (vertical) { drag_line.el.attr("d",generateLinkPathV(drag_line.node.x+portX,drag_line.node.y,mousePos[0],mousePos[1],sc)); }else{ drag_line.el.attr("d",generateLinkPath(drag_line.node.x+sc*drag_line.node.w/2,drag_line.node.y+portY,mousePos[0],mousePos[1],sc)) @@ -2088,13 +2088,13 @@ RED.view = (function() { if (isLink) { d.w = node_height; } else { - if (virtical) { + if (vertical) { d.w = Math.max(node_width,20*(Math.ceil((calculateTextWidth(l, "node_label", 50)+(d._def.inputs>0?7:0))/20)),(d.outputs||0) * 15 ); }else{ d.w = Math.max(node_width,20*(Math.ceil((calculateTextWidth(l, "node_label", 50)+(d._def.inputs>0?7:0))/20)) ); } } - if (virtical) { + if (vertical) { d.h = node_height; }else{ d.h = Math.max(node_height,(d.outputs||0) * 15); @@ -2284,7 +2284,7 @@ RED.view = (function() { if (!isLink && d.resize) { var l = RED.utils.getNodeLabel(d); var ow = d.w; - if (virtical) { + if (vertical) { d.w = Math.max(node_width,20*(Math.ceil((calculateTextWidth(l, "node_label", 50)+(d._def.inputs>0?7:0))/20)),(d.outputs||0) * 15 ); d.h = node_height; }else{ @@ -2330,7 +2330,7 @@ RED.view = (function() { } var numOutputs = d.outputs; - if (virtical) { + if (vertical) { var x = (d.w/2)-((numOutputs-1)/2)*13; }else{ var y = (d.h/2)-((numOutputs-1)/2)*13; @@ -2350,7 +2350,7 @@ RED.view = (function() { d._ports.exit().remove(); if (d._ports) { numOutputs = d.outputs || 1; - if (virtical) { + if (vertical) { x = (d.w/2)-((numOutputs-1)/2)*13; var y = d.h - 5; }else{ @@ -2360,7 +2360,7 @@ RED.view = (function() { d._ports.each(function(d,i) { var port = d3.select(this); //port.attr("y",(y+13*i)-5).attr("x",x); - if (virtical) { + if (vertical) { port.attr("transform", function(d) { return "translate("+((x+13*i)-5)+","+ y +")";}); }else{ port.attr("transform", function(d) { return "translate("+x+","+((y+13*i)-5)+")";}); @@ -2427,7 +2427,7 @@ RED.view = (function() { thisNode.selectAll(".port_input").each(function(d,i) { var port = d3.select(this); - if (virtical) { + if (vertical) { port.attr("transform",function(d){return "translate("+((d.w/2)-5)+", -5)";}) }else{ port.attr("transform",function(d){return "translate(-5,"+((d.h/2)-5)+")";}) @@ -2567,7 +2567,7 @@ RED.view = (function() { link.attr("d",function(d){ var numOutputs = d.source.outputs || 1; var sourcePort = d.sourcePort || 0; - if (virtical) { + if (vertical) { var x = -((numOutputs-1)/2)*13 +13*sourcePort; d.x1 = d.source.x+x; d.y1 = d.source.y+d.source.h/2; @@ -2998,11 +2998,11 @@ RED.view = (function() { updateGrid(); } }, - virtical: function(v) { + vertical: function(v) { if (v === undefined) { - return virtical; + return vertical; } else { - virtical = v; + vertical = v; RED.view.redraw(); } },