diff --git a/graphic/webGL/src/main/js/test/WebGL.test03.js b/graphic/webGL/src/main/js/test/WebGL.test03.js index f7403aa9a978561853c4da5a544acba737dfb51f..6851c009bd03da333f7412a5481d170833689611 100644 --- a/graphic/webGL/src/main/js/test/WebGL.test03.js +++ b/graphic/webGL/src/main/js/test/WebGL.test03.js @@ -579,15 +579,16 @@ export default function webgl1Test_webgl3() { //initContext(); console.info('jsWebGL getParameter test start ...' + JSON.stringify(gl)); - //设置线宽: - gl.lineWidth(5); - // 获取线宽: - const lineWidthValue = gl.getParameter(gl.LINE_WIDTH); - console.info("lineWidthValue: " + lineWidthValue); // 获取可用宽度的范围。返回一个Float32Array. const lineWidthArray = gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE); console.info("lineWidthArray: " + lineWidthArray); - expect(lineWidthValue).assertEqual(5); + //设置线宽: + const width = Math.max(...lineWidthArray); + gl.lineWidth(width); + // 获取线宽: + const lineWidthValue = gl.getParameter(gl.LINE_WIDTH); + console.info("width: " + width + "lineWidthValue: " + lineWidthValue); + expect(lineWidthValue).assertEqual(width); done(); });