Skip to content

Commit 4abef71

Browse files
committed
Add webgl edge guard in texture getter
Ref: Random "Script Error" thrown when generating nodes and edges in newest webgl version #3365
1 parent a86942b commit 4abef71

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/extensions/renderer/canvas/webgl/drawing-elements-webgl.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,14 @@ export class ElementDrawingWebGL {
556556
return;
557557
}
558558

559+
// Edges are not drawn as textures
560+
// Edges with invalid points could be passed here, causing errors
561+
// Ref: Random "Script Error" thrown when generating nodes and edges in newest webgl version #3365
562+
// https://github.com/cytoscape/cytoscape.js/issues/3365
563+
if(ele.isEdge()) {
564+
return;
565+
}
566+
559567
if(this.renderTarget.picking && opts.getTexPickingMode) {
560568
const mode = opts.getTexPickingMode(ele);
561569
if(mode === TEX_PICKING_MODE.IGNORE) {

0 commit comments

Comments
 (0)