MCPcopy Create free account
hub / github.com/AI-FanGe/OpenAIglasses_for_Navigation / setupCanvas

Method setupCanvas

static/visualizer.js:36–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 }
35
36 setupCanvas() {
37 // 设置画布大小
38 const resizeCanvas = () => {
39 const rect = this.canvas.getBoundingClientRect();
40 this.canvas.width = rect.width * window.devicePixelRatio;
41 this.canvas.height = rect.height * window.devicePixelRatio;
42 this.ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
43 };
44
45 window.addEventListener('resize', resizeCanvas);
46 resizeCanvas();
47 }
48
49 connectWebSocket() {
50 const wsUrl = `ws://${window.location.host}/ws/visualizer`;

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected