drawdb-io / drawdb-io/drawdb

[BUG]New Elements (Tables, Notes, Areas) Overlap at Same Position

Open
#736 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
39.5k
Forks
3.2k
Avg merge
10h 46m
Merged PRs (30d)
16

Description

# Bug : New Elements (Tables, Notes, Areas) Overlap at Same Position

## Describe the bug
When adding multiple tables, notes, or areas consecutively, all new elements are created at the exact same position (center of current view), causing them to stack perfectly on top of each other. Users cannot see that multiple elements were created without manually dragging each one apart.

## To Reproduce
Steps to reproduce the behavior:

### For Tables:
1. Open the editor
2. Click "Add Table" button 3 times
3. Observe that only ONE table is visible
4. Drag the visible table aside
5. See that 2 more tables were hidden underneath at the exact same position

### For Notes:
1. Open the editor
2. Click "Add Note" button 3 times
3. Observe that only ONE note is visible
4. Drag the visible note aside
5. See that 2 more notes were hidden underneath at the exact same position

### For Areas:
1. Open the editor
2. Click "Add Area" button 3 times
3. Observe that only ONE area is visible
4. Drag the visible area aside
5. See that 2 more areas were hidden underneath at the exact same position

## Expected behavior
Each new element should be positioned with a slight offset from the previous one (e.g., 20px down and 20px right), creating a cascading effect. This should be standard behavior in diagramming tools allowing users to immediately see all created elements without manual repositioning.

## Video

https://github.com/user-attachments/assets/3c559b20-b4c0-4107-a6c3-482697a6a9a9

## Desktop
- OS: macOS
- Browser: Chrome

## Additional context
All three use `transform.pan.x` and `transform.pan.y` directly without any offset, causing every new element to appear at the same coordinates.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.