Skip to content

Commit

Permalink
graph builder: Fix scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
timgott committed Apr 29, 2024
1 parent 4fad4d8 commit 8ba1e45
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion localgraphs/src/interaction/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ export class InteractionController {

const width = this.canvas.clientWidth
const height = this.canvas.clientHeight
this.ctx.reset()

this.ctx.save() // do not reset, since the scale has to be preserved
this.ctx.fillStyle = "transparent"
this.ctx.clearRect(0, 0, width, height)

const sleepState = this.system.animate({
dt,
Expand All @@ -145,6 +148,8 @@ export class InteractionController {
dragState: this.dragState,
})

this.ctx.restore()

this.previousTimeStamp = timeStamp

if (sleepState === "Running") {
Expand Down

0 comments on commit 8ba1e45

Please sign in to comment.