From 9bc51ed2e5af2bdc8eed1df292d2b1e90cf7b59d Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Thu, 15 Sep 2011 15:53:12 -0700 Subject: [PATCH] Implemented @rectalogic Loader.extractUrlbase fix. --- src/extras/loaders/Loader.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extras/loaders/Loader.js b/src/extras/loaders/Loader.js index edc09bf6..b997931a 100644 --- a/src/extras/loaders/Loader.js +++ b/src/extras/loaders/Loader.js @@ -59,7 +59,7 @@ THREE.Loader.prototype = { var chunks = url.split( "/" ); chunks.pop(); - return chunks.join( "/" ); + return chunks.length < 1 ? "." : chunks.join( "/" ); }, @@ -136,7 +136,7 @@ THREE.Loader.prototype = { } - function create_texture ( where, name, sourceFile, repeat, offset, wrap ) { + function create_texture( where, name, sourceFile, repeat, offset, wrap ) { var texture = document.createElement( 'canvas' ); @@ -174,7 +174,7 @@ THREE.Loader.prototype = { } - function rgb2hex ( rgb ) { + function rgb2hex( rgb ) { return ( rgb[ 0 ] * 255 << 16 ) + ( rgb[ 1 ] * 255 << 8 ) + rgb[ 2 ] * 255;