Skip to content
This repository was archived by the owner on Dec 28, 2024. It is now read-only.
This repository was archived by the owner on Dec 28, 2024. It is now read-only.

Overflow when using values too large for integers #1

Open
@dmac000

Description

@dmac000

Using large integers in the input paths gives overflowed values in the results. This seems to be solved by removing some casts from the library.

In ClipperOffset.java, there are casts to int, where the expected type is long. These casts can be removed:

destPoly.add( new LongPoint( (int) Math.round( srcPoly.get( 0 ).getX() + X * delta ), (int) Math.round( srcPoly.get( 0 ).getY() + Y * delta ) ) );

also in Edge.java:

return (int) (edge.getBot().getX() + Math.round( edge.deltaX * (currentY - edge.getBot().getY()) ));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions