Skip to content

6.99.39 — ink draws shapes

Pre-release
Pre-release

Choose a tag to compare

@ppardi ppardi released this 02 Oct 20:13
· 34 commits to 6.1.x since this release

Ink draws shapes.

Three shapes, and the pen among them

A tool button in the toolbar showing what the next stroke will be, opening four
choices: Pen, Line, Rectangle, Ellipse. Drag to place one — the drag sets two
opposite corners, and a rectangle spans them while an ellipse is inscribed in
them.

The pen is a member of the set rather than the absence of one, so the mode has a
single home and what you are about to draw is where your eye already is. Unlike
the color, the tool is not remembered between drawings: a color is a
preference, a tool is a momentary intent, and someone coming back to a note
means to write.

A line within 5° of flat or upright snaps true, which is what makes a
section delimiter worth having. Rectangles and ellipses do not snap — a square
is a rectangle dragged square by eye, which is the cost of never fighting
someone who meant the proportions they drew.

A shape is a stroke

A shape is stored as one densely sampled polyline, exactly like handwriting.
That is the whole design, and it is why nothing else had to change: the eraser
rubs out a rectangle's edge as it rubs out a word, Undo takes back the shape in
one press, the shape takes the ink color in force, and cropping, the picture,
the saved file and the theme filter are untouched.

A drag whose diagonal stays under 8 px commits nothing, so a stray tap leaves no
dot. Choosing a tool puts the eraser away, the rule choosing a color already
followed. A finger still pans and still never draws.

Drawing a shape is not drawing with a nib

This is the one place a shape is not treated exactly like handwriting, and it
was conceded to the device rather than chosen.

perfect-freehand exists to turn a hand's samples into a nib's mark: it smooths
the jitter and wraps the path in an outline. A construction has no jitter, so
the smoothing had nothing to do but cut the corners — a 200×120 rectangle's
corner landed 1.75 px inside itself where a round join reaches 1.77 px
outside, and the edges were seen to taper into every turn. Worse, that outline
runs up one side of the path and back down the other, so a closed shape's
outline doubles back on itself where it began: WebKit fills that overlap half
a nib wider than the band
, putting a blister on the line exactly where every
rectangle and ellipse starts. Chromium fills it flat, which is why this took an
iPad to find.

A shape now carries ruled: true and is drawn as the path it is — the nib's
width, a round join and cap, and a closed path for a loop. Measured along the
top edge through the join, ink per column is flat to 0.00 in Chromium and 0.01
in WebKit, and the corner reaches 1.75 px past itself in both.

What a file written by this version means elsewhere

ruled is additive and its absence means "a hand", so every drawing saved
before this version is unaffected and every freehand stroke still is. A shape
opened by an older build is still the same polyline and still draws — it just
draws with the smoothing, which is what that build did anyway.

Also

  • Opening the color picker shuts the tool menu, and the other way round. Two
    popovers over one small bar, and only one decision at a time.
  • Panning the page mid-drag no longer stretches the shape being dragged, and
    Undo during a drag takes back the shape rather than a stroke you meant to
    keep.