Skip to content

Blocks move using top left corner as origin instead of pointer coordinates #10077

Description

@mikeharv

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

When blocks are dragged on the workspace, the decision to delete them (or other actions like moving them to a backpack) is determined based on the block's getRelativeToSurfaceXY() coordinates. This creates unexpected behavior if the block is dragged from somewhere further right on the block.

Reproduction steps

  1. Using a mouse, click a block's middle or right side to begin a drag.
  2. Move the block such that it's left edge slightly overlaps the toolbox without the cursor overlapping the block. (The block would be deleted.)
  3. Move the cursor over the trashcan without touching the top-left corner of the block to the trashcan. (The block would not be deleted).

Priority

No response

Stack trace

Screenshots

The mouse cursor could not be captured in these screenshots, unfortunately, but it was position at the 'to' label at the middle of the block.

This block would be deleted if dropped here:

Image

This block would not be deleted if dropped here:

Image

Browsers

No response

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

Metadata

Metadata

Assignees

Labels

status: triageIssues awaiting triage by a Blockly team member

Type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions