Fix issue 904 for Chrome on linux

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2068 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Ahmad Syazwan 2012-03-26 07:55:03 +00:00
parent c3f7b7541d
commit 49d9bf34d9
1 changed files with 7 additions and 6 deletions

View File

@ -2516,10 +2516,11 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
tlist.appendItem(svgroot.createSVGTransform()); tlist.appendItem(svgroot.createSVGTransform());
if(svgedit.browser.supportsNonScalingStroke()) { if(svgedit.browser.supportsNonScalingStroke()) {
//Handle crash for newer Chrome + Windows: https://code.google.com/p/svg-edit/issues/detail?id=904 //Handle crash for newer Chrome: https://code.google.com/p/svg-edit/issues/detail?id=904
// TODO: Remove this workaround (all isChromeWindows blocks) once vendor fixes the issue //Chromium issue: https://code.google.com/p/chromium/issues/detail?id=114625
var isChromeWindows = svgedit.browser.isChrome() && svgedit.browser.isWindows(); // TODO: Remove this workaround (all isChrome blocks) once vendor fixes the issue
if(isChromeWindows) { var isChrome = svgedit.browser.isChrome();
if(isChrome) {
var delayedStroke = function(ele) { var delayedStroke = function(ele) {
var _stroke = ele.getAttributeNS(null, 'stroke'); var _stroke = ele.getAttributeNS(null, 'stroke');
ele.removeAttributeNS(null, 'stroke'); ele.removeAttributeNS(null, 'stroke');
@ -2528,13 +2529,13 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
} }
} }
mouse_target.style.vectorEffect = 'non-scaling-stroke'; mouse_target.style.vectorEffect = 'non-scaling-stroke';
if(isChromeWindows) delayedStroke(mouse_target); if(isChrome) delayedStroke(mouse_target);
var all = mouse_target.getElementsByTagName('*'), var all = mouse_target.getElementsByTagName('*'),
len = all.length; len = all.length;
for(var i = 0; i < len; i++) { for(var i = 0; i < len; i++) {
all[i].style.vectorEffect = 'non-scaling-stroke'; all[i].style.vectorEffect = 'non-scaling-stroke';
if(isChromeWindows) delayedStroke(all[i]); if(isChrome) delayedStroke(all[i]);
} }
} }
} }