Bläddra i källkod

Merge pull request #6403 from Lowfab/feature/typefaceNodeError

Fix undefined self (FontUtils.js)
Ricardo Cabello 10 år sedan
förälder
incheckning
38660d3aa5
1 ändrade filer med 7 tillägg och 2 borttagningar
  1. 7 2
      src/extras/FontUtils.js

+ 7 - 2
src/extras/FontUtils.js

@@ -464,5 +464,10 @@ THREE.FontUtils.generateShapes = function ( text, parameters ) {
 } )( THREE.FontUtils );
 
 // To use the typeface.js face files, hook up the API
-self._typeface_js = { faces: THREE.FontUtils.faces, loadFace: THREE.FontUtils.loadFace };
-THREE.typeface_js = self._typeface_js;
+var typeface_js = { faces: THREE.FontUtils.faces, loadFace: THREE.FontUtils.loadFace };
+if ( typeof self !== 'undefined' ){
+	self._typeface_js = typeface_js;
+}
+THREE.typeface_js = typeface_js;
+
+