فهرست منبع

Fix error caused by undefined self when using three on the node.js command line (e.g. in tests)

Arthur Silber 10 سال پیش
والد
کامیت
88fc758860
1فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  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
+
+