mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-26 20:46:22 +01:00
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.