diff --git a/src/app.tsx b/src/app.tsx index 4c51b69..79eb2b6 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -9,6 +9,7 @@ import { useEffectfulReducer } from './ui/use-effectful-reducer'; import { relpos } from './util/dutil'; import { Point } from './util/types'; import { vint } from './util/vutil'; +import { canvas_bds_in_canvas } from './ui/widget-helpers'; type Dispatch = (action: Action) => void; @@ -143,8 +144,8 @@ export function resizeView(c: HTMLCanvasElement): ViewData { const ratio = devicePixelRatio; const parent = c.parentElement?.getBoundingClientRect(); - const w = 640; - const h = 480; + const w = canvas_bds_in_canvas.sz.x; + const h = canvas_bds_in_canvas.sz.y; c.width = w; c.height = h; diff --git a/src/ui/widget-helpers.ts b/src/ui/widget-helpers.ts index 7559a2e..88b2c02 100644 --- a/src/ui/widget-helpers.ts +++ b/src/ui/widget-helpers.ts @@ -5,7 +5,7 @@ import { GameState } from "../core/state"; export const HAND_WIDTH = 100; -export const canvas_bds_in_canvas: Rect = { p: { x: 0, y: 0 }, sz: { x: 640, y: 480 } }; +export const canvas_bds_in_canvas: Rect = { p: { x: 0, y: 0 }, sz: { x: 800, y: 600 } }; export const hand_bds_in_canvas: Rect = { p: { x: canvas_bds_in_canvas.sz.x - HAND_WIDTH, y: 0 }, sz: { x: HAND_WIDTH, y: canvas_bds_in_canvas.sz.y }