Skip to content

Commit

Permalink
Rounded rendered positions for minor performance increase
Browse files Browse the repository at this point in the history
  • Loading branch information
zachsents committed Dec 26, 2021
1 parent ae71feb commit 2c0bf44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function setup(nodes, links) {
export function draw(nodes, links) {
for(let node of nodes) {
let nodeDiv = document.getElementById(node.id)
nodeDiv.style.transform = `translate(${node.pos.x() * SCALE}px,${node.pos.y() * SCALE}px)`
nodeDiv.style.transform = `translate(${round(node.pos.x() * SCALE, 1)}px,${round(node.pos.y() * SCALE, 1)}px)`
}

for(let link of links)
Expand Down

0 comments on commit 2c0bf44

Please sign in to comment.