Skip to content

settings.linerSlop is used incorrectly in PolygonShape.set #113

@tfoel

Description

@tfoel

When checking the polygon's vertices for uniqueness, the following is implemented:

if (v.distanceToSquared(points[j]) < 0.5 * settings.linearSlop)

linearSlop is said to be in distance units, not squared, so here one should use settings.linearSlop * settings.linearSlop like it's done in all other places.
This prevents polygons with seemingly legal point distance (e.g 0.04 vs slop = 0.005) being created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions