diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js
index 362edcf3..3658ff61 100644
--- a/editor/svgcanvas.js
+++ b/editor/svgcanvas.js
@@ -192,10 +192,10 @@ function SvgCanvas(c)
var recalculateSelectedOutline = function() {
if (selected != null && selectedOutline != null) {
var bbox = selected.getBBox();
- var sw = selected.getAttribute("stroke-width");
+ var sw = parseInt(selected.getAttribute("stroke-width"));
var offset = 1;
- if (sw != null && sw != "") {
- offset += parseInt(sw)/2;
+ if (!isNaN(sw)) {
+ offset += sw/2;
}
if (selected.tagName == "text") {
offset += 2;
@@ -217,9 +217,11 @@ function SvgCanvas(c)
start_x = x;
start_y = y;
var t = evt.target;
- if (t != svgroot) {
- selectElement(t);
+ // WebKit returns
when the canvas is clicked, Firefox/Opera return