Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Tacodiva committed Aug 15, 2024
1 parent 8f81761 commit 3f1e425
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/PenSkin.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class PenSkin extends Skin {

if (!gl.drawArraysInstanced) {
// Fallback to ANGLE_instanced_arrays
this.instanced_arrays_ext = gl.getExtension("ANGLE_instanced_arrays");
this.instanced_arrays_ext = gl.getExtension('ANGLE_instanced_arrays');
}

this.onNativeSizeChanged = this.onNativeSizeChanged.bind(this);
Expand Down Expand Up @@ -404,7 +404,11 @@ class PenSkin extends Skin {
this.instanced_arrays_ext.vertexAttribDivisorANGLE(this.a_lineThicknessAndLength_loc, 1);
this.instanced_arrays_ext.vertexAttribDivisorANGLE(this.a_penPoints_loc, 1);

this.instanced_arrays_ext.drawArraysInstancedANGLE(gl.TRIANGLES, 0, 6, this.attribute_index / PEN_ATTRIBUTE_STRIDE);
this.instanced_arrays_ext.drawArraysInstancedANGLE(
gl.TRIANGLES,
0, 6,
this.attribute_index / PEN_ATTRIBUTE_STRIDE
);

this.instanced_arrays_ext.vertexAttribDivisorANGLE(this.a_lineColor_loc, 0);
this.instanced_arrays_ext.vertexAttribDivisorANGLE(this.a_lineThicknessAndLength_loc, 0);
Expand All @@ -414,7 +418,11 @@ class PenSkin extends Skin {
gl.vertexAttribDivisor(this.a_lineThicknessAndLength_loc, 1);
gl.vertexAttribDivisor(this.a_penPoints_loc, 1);

gl.drawArraysInstanced(gl.TRIANGLES, 0, 6, this.attribute_index / PEN_ATTRIBUTE_STRIDE);
gl.drawArraysInstanced(
gl.TRIANGLES,
0, 6,
this.attribute_index / PEN_ATTRIBUTE_STRIDE
);

gl.vertexAttribDivisor(this.a_lineColor_loc, 0);
gl.vertexAttribDivisor(this.a_lineThicknessAndLength_loc, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/RenderWebGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class RenderWebGL extends EventEmitter {
throw new Error('Could not get WebGL context: this browser or environment may not support WebGL.');
}

if (!gl.getExtension("ANGLE_instanced_arrays") && !gl.drawArraysInstanced) {
if (!gl.getExtension('ANGLE_instanced_arrays') && !gl.drawArraysInstanced) {
throw new Error('Instanced rendering not supported.');
}

Expand Down

0 comments on commit 3f1e425

Please sign in to comment.