From 684d1e249f761d20e9f4daeceb4cef4932502d0b Mon Sep 17 00:00:00 2001 From: Hk-Gosuto Date: Thu, 9 Jan 2025 00:04:06 +0800 Subject: [PATCH] fix: realtime animation dpi --- .../openai-voice-visualizer/openai-voice-visualizer.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/openai-voice-visualizer/openai-voice-visualizer.tsx b/app/components/openai-voice-visualizer/openai-voice-visualizer.tsx index 5c4f56caed3..5d1f1b3cc24 100644 --- a/app/components/openai-voice-visualizer/openai-voice-visualizer.tsx +++ b/app/components/openai-voice-visualizer/openai-voice-visualizer.tsx @@ -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,