Skip to content

Commit

Permalink
adjusting sparkline canvas size ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacbowen committed Mar 4, 2024
1 parent 9c0713c commit f12e405
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class SphereWithRods {
this.camera.aspect = window.innerWidth / window.innerHeight;
this.camera.updateProjectionMatrix();
this.renderer.setSize(window.innerWidth, window.innerHeight);
this.sparklineCanvas.width = Math.min(window.innerWidth, window.innerHeight) * 0.5;
this.sparklineCanvas.height = this.sparklineCanvas.width * 0.3;
}

constructSphere(): void {
Expand All @@ -71,7 +69,7 @@ class SphereWithRods {
this.sparklineCanvas = document.getElementById('sparkline-canvas') as HTMLCanvasElement;
this.sparklineContext = this.sparklineCanvas.getContext('2d')!;
this.sparklineCanvas.width = Math.min(window.innerWidth, window.innerHeight) * 0.5;
this.sparklineCanvas.height = this.sparklineCanvas.width * 0.3;
this.sparklineCanvas.height = this.sparklineCanvas.width * 0.35;
this.startTime = Date.now();
this.drawSparkline();
}
Expand Down

0 comments on commit f12e405

Please sign in to comment.