Преглед на файлове

Fixed INVALID_OPERATION error with WebGL when using linewidth on IE11

Ludovic Bailly преди 9 години
родител
ревизия
9a75363822
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      src/renderers/webgl/WebGLState.js

+ 3 - 1
src/renderers/webgl/WebGLState.js

@@ -336,6 +336,8 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
 
 	var maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );
 
+	var lineWidthAvailable = parseFloat(gl.getParameter(gl.VERSION).split(' ')[1]) >= 1.0;
+
 	var currentTextureSlot = null;
 	var currentBoundTextures = {};
 
@@ -724,7 +726,7 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
 
 	function setLineWidth( width ) {
 
-		if ( width !== currentLineWidth ) {
+		if ( lineWidthAvailable && width !== currentLineWidth ) {
 
 			gl.lineWidth( width );