Skip to content

Add ellipse, polygon and point selections to the Analyze panel - #17

Merged
curlh merged 2 commits into
mainfrom
feature/shape-tools
Oct 16, 2026
Merged

curlh merged 2 commits into
mainfrom
feature/shape-tools

Conversation

@curlh

@curlh curlh commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

The Analyze panel now has a row of line-drawn tool icons in the style of ImageJ: Select, Rectangle, Ellipse, Polygon, Line and Point. The icons are drawn with the palette colors, so they follow the light and dark themes.

Ellipse is dragged like a rectangle. Polygon is drawn by clicking the corners and closed by a double-click, Enter or a click on the first corner; Backspace takes back a corner and Esc cancels. Point is a single click. All of them can be selected, moved and deleted, and polygon corners can be dragged. Selection statistics count the pixels whose centers are inside the shape, and the summary shows area and, for polygons, perimeter.

Markups in saved documents can be of the new types. The polygon corners are stored in an optional points field, so existing documents are unchanged. The API lists the new shapes but cannot create them yet.

Tested: the pixel counts and means for ellipses, polygons and points on a synthetic image, the save and load of a document with every shape type, and the rejection of a polygon with fewer than three corners. Not tested: drawing and dragging on the canvas, which needs OpenGL and was not run, and the look of the icons in dark mode.

@curlh
curlh merged commit 0de05a9 into main Oct 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant