summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--edit.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/edit.js b/edit.js
index 0d87e78..af1611d 100644
--- a/edit.js
+++ b/edit.js
@@ -220,8 +220,11 @@ up = function () {
}
target_shapes.splice(i, 1);
delete shapes_by_id[this["id_"]];
- del.pair.remove();
- del.remove();
+ var x = del.pair;
+ if (x)
+ x.remove();
+ if (del)
+ del.remove();
snap_to_grid(true);
return;
@@ -427,7 +430,7 @@ add_obj = function()
make_obj(xbegin+padding, "X", "target", 0);
} else {
make_obj(shapes[max_idx].getBBox().x2+(margin-padding),
- "NEW",
+ "X",
"target",
max+1);
}