From d417b3315f1aa6dd52fea10cbf5f17a213ef8726 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 29 Feb 2012 06:50:51 -0800 Subject: SnapManager fixes for sag tags. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/snap-manager.js | 6 ++++-- js/helper-classes/3D/view-utils.js | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 94202dc5..372be345 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -597,7 +597,8 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { } // TODO - Don't traverse components' children - if(elt.elementModel && elt.elementModel.isComponent) +// if(elt.elementModel && elt.elementModel.isComponent) + if(elt.nodeName.toLowerCase() === "svg" || (elt.elementModel && (elt.elementModel.isComponent || (elt.elementModel.selection === "SVG")))) { return; } @@ -1007,7 +1008,8 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { } // TODO - Don't traverse components' children - if(elt.elementModel && elt.elementModel.isComponent) +// if(elt.elementModel && elt.elementModel.isComponent) + if(elt.nodeName.toLowerCase() === "svg" || (elt.elementModel && (elt.elementModel.isComponent || (elt.elementModel.selection === "SVG")))) { return; } diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index bedda8bf..c1f59397 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -580,7 +580,8 @@ exports.ViewUtils = Montage.create(Component, { if (elt.style.height) h = MathUtils.styleToNumber(elt.style.height); } - if (elt instanceof SVGSVGElement) { +// if (elt instanceof SVGSVGElement) { + if(elt.nodeName.toLowerCase() === "svg") { if(w instanceof SVGAnimatedLength) w = w.animVal.value; if(h instanceof SVGAnimatedLength) -- cgit v1.2.3