From 36d358fff862afe2f1f3d016218617817196f338 Mon Sep 17 00:00:00 2001 From: Julian Viereck Date: Sun, 16 Sep 2012 07:46:13 -0700 Subject: [PATCH] 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 --- src/fonts.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fonts.js b/src/fonts.js index e344bbf4b..0fee585c4 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -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) {