Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update webglLinkProgram.js #277

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/WebGL/webglLinkProgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* This form allows to change color of links.
**/

var glUtils = require('./webgl.js');
let glUtils = require('./webgl.js');

module.exports = webglLinkProgram;

/**
* Defines UI for links in webgl renderer.
*/
function webglLinkProgram() {
var ATTRIBUTES_PER_PRIMITIVE = 6, // primitive is Line with two points. Each has x,y and color = 3 * 2 attributes.
let ATTRIBUTES_PER_PRIMITIVE = 6, // primitive is Line with two points. Each has x,y and color = 3 * 2 attributes.
BYTES_PER_LINK = 2 * (2 * Float32Array.BYTES_PER_ELEMENT + Uint32Array.BYTES_PER_ELEMENT), // two nodes * (x, y + color)
linksFS = [
'precision mediump float;',
Expand Down Expand Up @@ -56,7 +56,7 @@ function webglLinkProgram() {
if ((linksCount+1)*BYTES_PER_LINK > storage.byteLength) {
// Every time we run out of space create new array twice bigger.
// TODO: it seems buffer size is limited. Consider using multiple arrays for huge graphs
var extendedStorage = new ArrayBuffer(storage.byteLength * 2),
let extendedStorage = new ArrayBuffer(storage.byteLength * 2),
extendedPositions = new Float32Array(extendedStorage),
extendedColors = new Uint32Array(extendedStorage);

Expand All @@ -83,7 +83,7 @@ function webglLinkProgram() {
},

position: function (linkUi, fromPos, toPos) {
var linkIdx = linkUi.id,
let linkIdx = linkUi.id,
offset = linkIdx * ATTRIBUTES_PER_PRIMITIVE;
positions[offset] = fromPos.x;
positions[offset + 1] = fromPos.y;
Expand Down