Skip to content

Bug: Gratuitous polygon simplification #595

Closed

Description

@microfauna

Hello! I have some complex polygons. When I am editing them, the detailed shape is preserved, but when I deselect- all details are lost. Is there a way to disable this? If not, can you point me to the code where this is happening, so I could make the changes and maybe PR it?

(simplified)
Image

(complex)
Image

(Is it due to this?

)

Activity

  1. rsimon commented on Jan 21, 2026

    @rsimon
    Member

    Hi @microfauna,

    yes, that's correct. There's on-the-fly polygon simplification in the rendering layer. A bit of a self-protection mechanism that helps preserve performance when polygons get very complex and/or there are many annotations. But I can see how that's not the priority sometimes.

    The the code you're pointing to calls the simplifyPolygon and simplifyMultipolygon functions. Both have a second optional argument (not used in PixiLayer) called tolerance.

    One possible approach would be to make this configurable as an init argument to Annotorious. You can see the effect that tolerance has on polygon smoothing here:

    https://mourner.github.io/simplify-js/

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions