mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17: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 () {
|
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
|
// Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround
|
||||||
try {
|
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) {
|
} catch(e) {
|
||||||
computedWidth = 10;
|
computedWidth = 10;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user