diff options
author | Patrick Simianer <p@simianer.de> | 2015-09-02 13:48:15 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-09-02 13:48:15 +0200 |
commit | 9081a98f9803bbc28b05450e430c1fe6499c917f (patch) | |
tree | 178a188212f42fbe83a257d695e9099b5e1c3021 | |
parent | c3974ae7c39479498ecb3b44fb47e629be310cbe (diff) |
fixes & tweaks
-rw-r--r-- | edit.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -104,6 +104,7 @@ make_conns_from_a = function (align) */ var dragger = function () { + if (edit_mode) return; curDrag = this; if (this.type == "text") curDrag = this.pair; @@ -120,6 +121,7 @@ var dragger = function () }, move = function (dx, dy) { + if (edit_mode) return; var att = { x: this.ox + dx, y: this.oy }; this.attr(att); att = { x: this.pair.ox + dx, y: this.pair.oy }; @@ -299,14 +301,14 @@ var make_obj = function(x, text, type) } else if (e.keyCode==27||e.keyCode==37||e.keyCode==38||e.keyCode==39||e.keyCode==40) { // esc, arrows, backspace return; } else if (e.keyCode == 8) { // backspace - curEdShape.animate({width:curEdShape.getBBox().width-14},125); + curEdShape.animate({width:curEdShape.getBBox().width-font_width},125); setTimeout(function(){snap_to_grid(true);},125); } else { - curEdShape.animate({width:curEdShape.getBBox().width+font_width},125); + curEdShape.animate({width:(this.value.length*font_width)+2*font_width+2*padding},25); setTimeout(function(){ snap_to_grid(true); r.setSize(r.width+font_width, r.height); - },125); + },25); } }); input.addEventListener("blur", function(e) { |