Browse Source

Merge pull request #20897 from gonnavis/SimplifyRegExpOfWebGLState

Simplify RegExp of WebGLState.js
Mr.doob 4 years ago
parent
commit
fdf94074a0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/renderers/webgl/WebGLState.js

+ 2 - 2
src/renderers/webgl/WebGLState.js

@@ -344,12 +344,12 @@ function WebGLState( gl, extensions, capabilities ) {
 
 	if ( glVersion.indexOf( 'WebGL' ) !== - 1 ) {
 
-		version = parseFloat( /^WebGL\ ([0-9])/.exec( glVersion )[ 1 ] );
+		version = parseFloat( /^WebGL (\d)/.exec( glVersion )[ 1 ] );
 		lineWidthAvailable = ( version >= 1.0 );
 
 	} else if ( glVersion.indexOf( 'OpenGL ES' ) !== - 1 ) {
 
-		version = parseFloat( /^OpenGL\ ES\ ([0-9])/.exec( glVersion )[ 1 ] );
+		version = parseFloat( /^OpenGL ES (\d)/.exec( glVersion )[ 1 ] );
 		lineWidthAvailable = ( version >= 2.0 );
 
 	}