Skip to content

Canvas Resize During Gameplay Causes Incorrect Proportions #235

@Skjesper

Description

@Skjesper

Priority: Medium
Component: RuneHuntGame.tsx
Description

When the browser window is resized during active gameplay, the canvas dimensions update but the rune positions and sizes don't scale proportionally, causing visual inconsistencies and gameplay issues.
Steps to Reproduce

Start a game and wait for gameplay to begin
Resize the browser window (make it smaller or larger)
Observe that runes appear in incorrect positions relative to the new canvas size
Some runes may appear outside the visible canvas area

Current Behavior

Canvas dimensions update via updateCanvasSize()
Existing runes maintain their absolute pixel positions
Runes don't scale relative to the new canvas size
RuneGenerator creates new runes with correct dimensions, but existing runes are misplaced

Expected Behavior

When canvas resizes, all existing runes should scale proportionally
Rune positions should be converted from old canvas coordinates to new canvas coordinates
Rune radii should scale based on the canvas size change ratio

Suggested Fix
Add a function to scale existing runes when canvas resizes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions