A second press from a center let go within 2 screen points of the press
showed the circle through the pointer but drew it through the press, and
the tests for a drag brought back near its press asked for the opposite
of the click rule on main. The preview of such a press now shows the
pressed point until it has been dragged, and the tests follow the rule
that a first press let go near its press places the first point.
A second press within 3 screen points of the first point but not on it,
let go where it was pressed, placed nothing but left the pointer at the
press, so the tool showed a circle about 2 pt across until the pointer
moved. Such a click now puts the pointer back on the first point.
- tool.setOption accepts fromCenter again: the Circle tool implements
check_option, which the shared option check now calls for every tool.
- A drag from the first point that comes back within 2 screen points of
the press draws the circle the tool shows. A drag to no circle draws
nothing and leaves no point pending.
- shape.circleThroughPoints refuses a circle whose opposite edges round
to the same number at its coordinates, and the tool no longer shows
such a circle. The error is translated in every complete-message
catalog.
- An option set during a press (tool.setOption, the Control bar) is kept
when the press is dropped, with the options that write reset.
The Circle tool now answers Tool::check_option with the values
check_options takes, so tool.setOption and the option check that runs
on every tool accept the options the tool reports.
- With Third Point by Dragging off, a click in reach of both placed
points is on the nearer one (or the one it snapped to).
- A press on the second point previews the circle on the two points
that its release draws, and a press on the first point previews none.
- With Anchors at Standard Positions off, the preview is the path with
an anchor at each point, which the release draws.
- A move of less than 2 screen points keeps the second or third point
where it was pressed.
- circle_with_anchors_at gives the two ends of a diameter four anchors
also where rounding of the midpoint puts the second point more than
half a turn from the first.
- The canvas-edge test checks for an outline whether dashed or solid.
- docs/mcp.md says that only anchors: "standard" draws a live ellipse.
A press dragged away and let go within 2 screen points of where it was
pressed was still taken as a drag. A second press dragged out and back
drew the circle through three nearly collinear points, or nothing, and a
press on the first point drew a circle about 1 pt across. The release
distance now decides: such a release keeps the press's point, so a second
press draws the circle on the diameter to it, a press on the first point
places nothing, and a first press places the first point. The preview
and the guides of the drag go with it.
With Standard Anchors off, a circle near the canvas edge whose path with
anchors at the points curves past the edge is no longer previewed or
drawn, as shape.circleThroughPoints refuses it.
With From Center, a second press moved less than 2 screen points now
draws the outline through the pointer the preview follows, not through
the point of the press. A second click on the center still places
nothing.
A release away from the last drag point now moves the circle's points to
the release position before the circle is drawn, for a drag from the
first press, from a second press and from a press on the first point. A
release within 2 screen points of the press is still a click and keeps
the point of the press.
Double-clicking the Circle tool, or `tool.options {tool: "circle"}`, opens
Circle Tool Options. Show Center, Show Radii and Show Diameter switch the
center cross, the radius lines and the diameter label the tool shows while
a circle is drawn, and Color sets the color of the cross and the lines
(red, blue, magenta, green, black or gray). With Anchors at Standard
Positions off, the circle's anchors are at the points it was drawn
through, plus evenly spaced anchors between them so that no curve turns
more than a quarter of the circle. With Third Point by Dragging off, a
second click places the second point and a third click draws the circle
through the three; a double-click on the second point draws the circle on
the two. Every option is on by default, and the options are kept with the
preferences.
`shape.circleThroughPoints` takes `anchors: "standard"|"points"`.
`tool.setOption` rejects a value the Circle tool's options do not take.
With From Center on (a Control bar checkbox, or the tool option
fromCenter), the Circle tool's first point is the circle's center and
its outline passes through the second point, which follows the pointer.
A drag from the center, or a click on the center and a click on the
outline, draws the circle. The second point snaps to Smart Guides and
anchor points as the tool's other points do, so a circle centered on one
corner of a rectangle can pass exactly through the opposite corner, with
the diagonal as its radius. Shift keeps the second point at 45° steps
from the center, and Alt rounds the diameter to the rulers' ticks. A
second click on the center places nothing. The setting in force when
the first point is placed applies to that circle, and the setting is
saved with the preferences. Each circle is one undo step.
shape.circleThroughPoints takes center: [x, y] with one point in points
and draws the circle at the center through that point. A point on the
center, and coordinates whose distance overflows, are refused with their
own messages. tool.setOption refuses a fromCenter that is not true or
false and any other Circle tool option; both errors are translated.
Requested by Auriga on the community Discord. Part of #7178.
The Circle tool, in the Ellipse tool's flyout, draws a circle with
shape.circleThroughPoints. A drag from one point to another, or a click
on each, draws the circle with the two points as the ends of a diameter.
A click on a first point, then a press on a second point dragged to a
third, draws the circle through the three. Shift keeps the second point
at 45° steps from the first. For a circle on two points, Alt rounds the
diameter to the nearest ruler tick at the current zoom in the General
unit. Each point snaps to Smart Guides. Until the release the tool shows
the circle as a dashed outline (solid once it is more than 50,000 screen
points around), a cross at its center, a line from the center to each
point and, with Measurement Labels on, the diameter by the pointer.
Three different points on one line, or a circle past the canvas, show
"Circle too large" by the pointer instead, and the release draws
nothing. Escape, a dropped press, and an edit, Undo or Redo made outside
the tool drop the first point. A second press within 3 screen points of
the first point, or one that snaps to it, places nothing when let go
there, and draws the circle on the diameter it drags out when dragged.
Each circle is one undo step. The tool's icon is new and drawn for
VectorCraft.
shape.circleThroughPoints also takes two points, or two selected anchor
points, as the ends of a diameter. Its two errors about the number of
points now say "two or three", in every catalog that translates them.
Part of #7178.