Free-polygon tool specification

From GIMP GUI Redesign
Revision as of 17:56, 18 May 2008 by Guiguru (talk) (on the fly)
Jump to: navigation, search


This is the specification for the straight cross between the free selection tool and the new polygon selection tool, developed by Martin Nordholts. One can look at the combined tool as:

  • a polygon selection tool with the option to insert freely traced segments in between;
  • a free selection tool that connects free segments by polygons.

The free-polygon selection tool is meant to replace both the free and polygon selection tools.

between the lines

In principle the tool is used to build up a polygon, where the nodes shall be one of two types:

  1. a polygon point, which shall be created by a single click;
  2. a free segment which shall be created by a drag, in the same way as in the current free selection tool.

The free segment shall have two polygon points incorporated: one at the start (the coordinate where the mouse went down) and on at the end (the coordinate where the mouse went up).

The polygon points shall be displayed as in the new polygon select tool (also the two of a free segment)

straight to the point

The sequence of nodes in a polygon shall be interconnected by straight lines. For a free segment, the start polygon point shall be connected to the previous polygon point and the end polygon point shall be connected to the next polygon point.

Between creating nodes of a free-polygon, the tool shall rubber-band a straight line from the last (end) polygon point created to the mouse pointer coordinate.

start and finish

The creation of a free-polygon shall be able to be started by creating either node type.

The free-polygon shall be completed and closed by the following means:

  • clicking on the first (start) polygon point that initiated the creation of this free-polygon;
  • hitting the return key; this shall connect the last (end) polygon point with the first (start) polygon point that initiated the creation of this free-polygon by a straight line;
  • double clicking; this shall create a final polygon point at the coordinate where the mouse went down the first time of the double click and connect it with the first (start) polygon point that initiated the creation of this free-polygon by a straight line;

on the fly

Before the creation of a free-polygon has been completed, some editing of the intermediate result is possible.

Hitting the backspace or delete key shall delete the last created node, whether polygon point or free segment. If only one node existed, then the whole free-polygon creation the shall be terminated, as if it never happened (for instance: not replace another selection).

Every existing polygon point in the free-polygon shall highlight when the mouse pointer is closer than 4 times their radius and the mouse button is up. It shall be able to be grab an existing polygon point within its radius and move it, rubber-banding and adjusting the attached straight-line segments. For the free segments, grabbing either polygon point shall rotate the free segment along the two attached polygon points’ axis and scale it in the dimension perpendicular to it, as well as adjusting the attached straight-line segment.

When hovering the mouse within the radius display circle of a polygon point the display circle shall be shown and the line rubber-banding to the mouse coordinate temporarily suspended.

modifier keys

The usual add/subtract/intersect modes of selection creation shall be supported, including the use of shift and control modifier keys. As with the rectangle/oval select tools, it only counts whether the shift/control key was down at the moment selection creation commenced, which is here at the moment the mouse goes down to create the first node.

further tool options

  • Antialiasing and Feather edges