Don't use shadow() for spaceWidth as otherwise sendering the font over to the mainthread causes issues if the worker used the property and the main thread tries to assign the spaceWidth to the getter function

This commit is contained in:
Julian Viereck 2012-09-16 07:46:13 -07:00
parent fdb6a013c9
commit 36d358fff8

View File

@ -3181,6 +3181,10 @@ var Font = (function FontClosure() {
},
get spaceWidth() {
if (this._shadowWidth !== undefined) {
return this._shadowWidth;
}
// trying to estimate space character width
var possibleSpaceReplacements = ['space', 'minus', 'one', 'i'];
var width;
@ -3208,7 +3212,8 @@ var Font = (function FontClosure() {
break; // the non-zero width found
}
width = (width || this.defaultWidth) * this.widthMultiplier;
return shadow(this, 'spaceWidth', width);
this._shadowWidth = width;
return width;
},
charToGlyph: function Font_charToGlyph(charcode) {