Skip to content

[Bug] preventOverlappingLines does not check completed polygon for intersections if user hits Enter or double-click #157

Open
@solarissmoke

Description

@solarissmoke

Module

  • deck.gl-community/arrow-layers
  • deck.gl-community/bing-maps
  • deck.gl-community/editable-layers
  • deck.gl-community/experimental
  • deck.gl-community/graph-layers
  • deck.gl-community/layers
  • deck.gl-community/react
  • deck.gl-community/react-graph-layer

Description

When preventOverlappingLines is set to true, DrawPolygonMode prevents placing new vertices that overlap with the polygon. However, it is possible to create a self-intersection that is not detected, as demonstrated here:

Screencast.from.2024-11-20.06-35-51.webm

Notice that the polygon was successfully created, despite it having a self-intersection. This is because the current implementation doesn't check for intersection of the closing line segment of the polygon (between the last placed vertex, and the first vertex).

Expected Behavior

The self-intersection created above shouldn't be possible when preventOverlappingLines is turned on. Intersection needs to be checked on the final line segment.

Steps to Reproduce

See screen capture above - with preventOverlappingLines turned on, it is still possible to create a self-intersecting polygon.

Environment

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions