mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-14 10:47:57 +01:00
Hack Chrome text element issue.
This commit is contained in:
parent
f75124233b
commit
84c96287f3
@ -153,9 +153,16 @@ web2d.peer.svg.TextPeer = new Class({
|
||||
},
|
||||
|
||||
getWidth : function () {
|
||||
var computedWidth;
|
||||
// Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround
|
||||
try {
|
||||
var computedWidth = this._native.getBBox().width;
|
||||
computedWidth = this._native.getBBox().width;
|
||||
// Chrome bug is producing this error, oly during page loading. Remove the hack if it works. The issue seems to be
|
||||
// caused when the element is hidden.
|
||||
if(computedWidth==0){
|
||||
computedWidth = getBoundingClientRect().width - 35;
|
||||
}
|
||||
|
||||
} catch(e) {
|
||||
computedWidth = 10;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user