Skip to content

fix: use WALL_MIN_LENGTH constant to prevent ghost walls in sidebar#168

Merged
open-pascal merged 2 commits intopascalorg:mainfrom
thiago-lopes-dev:main
Mar 26, 2026
Merged

fix: use WALL_MIN_LENGTH constant to prevent ghost walls in sidebar#168
open-pascal merged 2 commits intopascalorg:mainfrom
thiago-lopes-dev:main

Conversation

@thiago-lopes-dev
Copy link
Copy Markdown
Contributor

Fixes #103

Problem

WALL_MIN_LENGTH was set to 0.01 (1cm), but the grid snaps in steps
of 0.5m. When a user placed a wall end point too close to the start,
the snapped points would coincide, creating a wall node with effectively
zero length that still passed the minimum length check and got persisted
to IndexedDB — causing the ghost entry in the sidebar and a crash on reload.

Changes

  • Increased WALL_MIN_LENGTH from 0.01 to 0.5 in wall-drafting.ts
  • Replaced hardcoded 0.01 * 0.01 checks in wall-tool.tsx with
    WALL_MIN_LENGTH * WALL_MIN_LENGTH so all validations stay in sync

Related

Closes #103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problems encountered during the process of drawing walls

2 participants