Skip to content

Commit

Permalink
Fix vertex drag bug in demo (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
juniorrojas authored Jul 18, 2024
1 parent 4ce0753 commit 2cd82fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions algovivo/Vertices.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class Vertices {
throw new Error("use fixVertex instead");
}

get fixedVertexId() {
return this._fixedVertexId;
}

fixVertex(vertexId) {
this._fixedVertexId = vertexId;
}
Expand Down
1 change: 1 addition & 0 deletions algovivo/render/ViewportVertices.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class ViewportVertices {
}

setVertexPos(i, p) {
if (i == null) throw new Error("vertex id required");
const system = this.system;
const pF32 = system.pos.slot.f32();
const offset = i * 2;
Expand Down

0 comments on commit 2cd82fa

Please sign in to comment.