Skip to content

Commit

Permalink
fix: realtime animation dpi
Browse files Browse the repository at this point in the history
  • Loading branch information
Hk-Gosuto committed Jan 8, 2025
1 parent 98b463b commit 684d1e2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ export function OpenAIVoiceVisualizer({
const initializeWebGL = useCallback(() => {
if (!canvasRef.current) return;

canvasRef.current.width = CANVAS_SIZE;
canvasRef.current.height = CANVAS_SIZE;
const dpi = window.devicePixelRatio || 1;
canvasRef.current.width = CANVAS_SIZE * dpi;
canvasRef.current.height = CANVAS_SIZE * dpi;

const { gl, program } = initWebGL(
canvasRef.current,
Expand Down

0 comments on commit 684d1e2

Please sign in to comment.