| 1 | # The Draw tab's tools |
| 2 | |
| 3 | `native-ui/notebook/ink.one` is OneNote 2010's own work in a lab clone, drawn with the |
| 4 | mouse from the Draw tab (screenshots of the tab, the pen gallery and Color & Thickness |
| 5 | were taken alongside): |
| 6 | |
| 7 | - "Pens": the first favourite pen (black, 35 HIMETRIC wide), a second stroke drawn at once |
| 8 | beside it, the red thick pen, the yellow highlighter, and shapes: rectangle, line, |
| 9 | arrow and oval with the default shape pen (black, 50 wide). |
| 10 | - "Gallery": one stroke with each of the 14 favourite pens in the gallery's order. |
| 11 | - "Edits": four strokes, the second removed by the stroke eraser, the third lassoed and |
| 12 | dragged 60 by 20 pixels, the fourth lassoed and deleted, then a rectangle and a line. |
| 13 | - "Shapes2": arrows at other angles and pen widths, a rectangle moved after drawing, and |
| 14 | lines in each of Color & Thickness's nine widths. |
| 15 | |
| 16 | What it shows, and `crates/onestore/tests/page_ink.rs` pins: |
| 17 | |
| 18 | - Every stroke and every shape is an ink container of its own, on top of the page; OneNote |
| 19 | never adds a stroke to an earlier drawing. Erasing or deleting removes the container; |
| 20 | moving sets its offset and leaves the strokes as they were. |
| 21 | - A pen's drawing attributes ignore pressure. A highlighter's tip is a 70 by 400 |
| 22 | rectangle (pen tip 1) with transparency 127 and raster operation 9 (MaskPen), and its |
| 23 | stroke's bias is 2. Strokes are numbered through the page. |
| 24 | - Pen widths are 25, 35, 50, 70, 100, 150, 200, 350 and 500 HIMETRIC. The favourites are |
| 25 | black, red `0x241ced`, blue `0xbb6531`, green `0x367d17` and grey `0x808080` at 35 and |
| 26 | 50, and yellow, cyan, green and magenta highlighters; black is stored as no colour. |
| 27 | - A shape's container stores 2 in `0x14001d4e` (1 for a drawn stroke), its kind in |
| 28 | `0x0c001d4f` (11 a line or arrow, 12 a closed shape) and its geometry: a line's ends in |
| 29 | half inches (`0x1c001dac`), or a closed shape's transform from the unit square in half |
| 30 | inches and its anchors in the unit square (`0x1c001daa`: 8 for a rectangle, 4 for an |
| 31 | oval). Its strokes carry only their path and pen, whose dimension table spans the whole |
| 32 | 32-bit range at resolution 1000. A rectangle is drawn clockwise from its top left, an |
| 33 | oval in 50 steps clockwise from its right end, and an arrow's head is a second stroke of |
| 34 | two barbs at atan(1/2) to the line, 8 points plus twice the pen width long. Shape |
| 35 | corners snap to the 18 pt grid. |
| 36 | |
| 37 | `native-ui/read` is a fresh OneNote 2010 read of that file. |
| 38 | |
| 39 | `drawn/candidate` is the page view's output for |
| 40 | `drawing_tools_store_each_stroke_and_undo_it_in_one_step` in |
| 41 | `crates/canvas/tests/ink_tools.rs` (`CANVAS_INK_EXPORT`): a pen stroke in an accent |
| 42 | colour, a yellow highlighter, and a rectangle, oval, arrow and line dragged out with the |
| 43 | shape tools, each its own edit. `drawn/cold` is a fresh OneNote 2010 read: six |
| 44 | `InkDrawing`s, the four shapes with their `ShapeInfo` anchors, drawn as Snowbound drew |
| 45 | them (`page-000.png`). |
| 46 | |
| 47 | `edited/candidate` is `onenote_drawings_take_erasing_moving_and_more_strokes` in |
| 48 | `page_ink.rs` (`ONESTORE_INK_TOOLS_EDIT_EXPORT`): the native file with the red zigzag on |
| 49 | "Pens" deleted, the vertical line moved by (36, 18), and the six drawings above added |
| 50 | below. `edited/cold` shows OneNote reading OneNote's own drawings where they were, the |
| 51 | moved one offset, and Snowbound's beside them. |
| 52 | |
| 53 | `tools/test_ink_tools.py` checks all three without a VM. Regenerate the candidates with |
| 54 | the export variables set to new absolute directories, then cold-open each with |
| 55 | `tools/native_runner.py OUTPUT COLD --expected-pages N --collect-notebook --screenshots`. |