Repository navigation
Lasso: an enlarged selection keeps its erasing and its white ink in scale, and a lasso round only erased ink selects nothing (#204, #205) - #206
Open
ganten1998 wants to merge 3 commits into
Conversation
…te ink and erasing alike (#204) A resize by a corner handle put the group down with its points scaled and every width kept in mm, ink, white ink and the erasing that goes with the ink alike. Made larger, the erasing no longer covered all the ink it had erased: a word erased in three passes and the page made 1.1 times as large showed faint traces of it after Done (the halo outlined them: editor.halo 4 instead of 3, about 230 dark pixels with the selection up, 10 after Done), at 1.5 times dark ones (about 1,460), and a line cut by close strokes of white ink showed through between them (121 to 142). Made smaller, the erasing took away ink that showed: a line's cut kept its width while the line shrank, so at half size the ink beside the cut was gone. lasso.rs lasso_scale_widths scales size_min_mm and size_max_mm of every stroke of the group by the resize's factor, black ink, white ink and erasing alike, so the group is put down as a picture of itself, larger or smaller, both ways: what its erasing hid stays hidden and what showed still shows, and a resize undone by the opposite one gives the widths back. A width stays within 0.1 to 12 mm, the range page_read clamps a page file's widths to and the brush draws, so the stroke reads back as it was put down; erasing that would be wider than 12 mm is drawn 12 mm wide (an 8 mm eraser past 1.5 times). Floor markers are left as they are. sel_place calls it for a resize (a move's spot has scale 1); a paste scaled to fit keeps the widths in mm, as scale_page does. Undo is unchanged (the step keeps the removed and the added strokes whole), and a floor is still decided plain or scoped from the strokes as they are put down, now with their scaled widths. Tests: test_lasso a_resize_scales_widths_with_the_group (a word erased by two passes, a line cut by the eraser, a line cut by white ink, at 1.1, 1.5, 2 and 0.5 times: nothing of the word more than 6 levels off the paper, each cut as wide as k times its width, the line wider; over ink outside the group the floor is scoped and that ink never lighter; widths clamped and read back). With the scaling taken out it fails 19 checks: 23, 307 and 921 pixels of the word at 1.1, 1.5 and 2, the white ink's cut 8 px for 48 and 64, the eraser's 20 px for 10 at half size. The scenario z_lasso_28_resize_erased: 1.1 and 1.5 times, smaller again over a scoped floor, half size, each undone (page_sig_same); on e018fc6 it fails 11 checks (the halo 4 for 3 three times; about 230, 10, 1,460, 121, 640 and 135 dark pixels at erased places; none of the ink beside the cut, both sides). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uoe9ZJNyEZYoc4bsjqbSyQ
…ng, as one round empty paper (#205) The lasso takes every ink stroke inside it, and ink erased wholly (by the precise eraser or white ink) stays in the page file under its erasing until compaction, so a lasso round only such ink selected it: since #187 it had no halo, and the selection showed a box round nothing with a bar whose Copy copied nothing. select.rs plan_shows tells whether the page shows any of the ink a lasso takes (its strokes taken whole and its pieces inside an exact-area lasso) by the halo's own rule, one function for both (shown_of: the page as drawn, stroke_shown_runs, else the estimate): would the selection have a halo anywhere. What the preview found and kept for the page as it is is read first, the rest found, the first stroke that shows ending it. When none shows and no link comes with it, lasso_done selects nothing and says "Nothing to select.", the toast of a lasso round empty paper; the mode button does the same when the lasso judged again in the other mode takes only such ink (the selection goes, Select mode stays). Beside ink that shows, erased ink is selected as before, so Copy, Cut and Delete behave as they did. A lasso that takes a link keeps it, with the erased ink: the link shows (its area drawn dashed), and the link rules (a link goes with every ink stroke inside its area) are unchanged. No new strings. Tests: z_lasso_29_erased_only, a lasso round a word the precise eraser took away and round one white ink covers (Nothing to select, nothing selected, no box drawn), round empty paper (as before), round a word that shows and an erased one (both selected, Delete takes both), round the erased word in exact area, and the mode button judging again into only the erased word. z_lasso_30_erased_link: such ink inside a link's area brings the link and is selected with it. z_lasso_23's lasso round the erased word alone now selects nothing, and its check that a moved selection's halo is found once at each place moves the erased word with the word above it (halo_found 2, 4 and 4; a selection of only such ink can no longer be made); z_lasso_24 lassoes where the stroke eraser took a word away (nothing left: as before). With plan_shows answering true, z_lasso_29 fails 13 checks (selected 1 for 0 four times, a box of 710 dark pixels round the erased word) and z_lasso_23 3; on e018fc6 z_lasso_29 fails the same 13. With only the mode button's check taken out, z_lasso_29 fails its last 3; with links no longer keeping the selection, z_lasso_30 fails 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uoe9ZJNyEZYoc4bsjqbSyQ
…ound erased ink, and the device checks (#204, #205) LASSO-DESIGN.md: row 10 of the matrix (a selection made larger or smaller by a corner: scaled as a picture of itself, widths and all, ink, white ink and erasing alike; what it did before; the 12 mm a width stays within, past which erasing stops growing; scoped over ink outside the selection; a paste scaled to fit keeps the widths in mm), 6.4 (where lasso_scale_widths comes in, and that floors are decided on the scaled strokes), and 6.2 (a lasso round only ink the page shows nothing of, with no link, says "Nothing to select."; "shows" is the halo's rule; beside ink that shows such ink is selected as before; a link keeps the selection; the mode button the same). TESTING.md: the device checks for both, 14 steps. CHANGELOG: folded into #187's lasso line. lasso.rs: the comment names page_parse, the reader that clamps a page file's widths (the commit before said page_read). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uoe9ZJNyEZYoc4bsjqbSyQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small lasso changes found during the work on #187.
A resize keeps the erasing and the white ink in scale (#204)
Before. A resize by a corner handle put the group down with its points scaled and every width kept in mm: black ink, white ink and the erasing carried with the ink alike (
translatedin rust/src/lasso.rs copies the stroke's parameters as they are). Made larger, the erasing no longer covered all the ink it had erased: a word erased in three passes, the page made 1.1 times as large, showed faint traces of the word after Done (the halo outlined them), dark ones at 1.5 times, and a line cut by close strokes of white ink showed through between them. Made smaller, the erasing took away ink that showed: a cut kept its width while the line around it shrank.Now.
lasso_scale_widths(lasso.rs) scalessize_min_mmandsize_max_mmof every stroke of the group by the resize's factor, black ink, white ink and erasing alike, andsel_placecalls it for a resize (a move's spot has scale 1). The group is put down as a picture of itself, larger or smaller.page_parseclamps a page file's widths to and the brush draws, so a stroke reads back as it was put down. Erasing that would be wider than 12 mm is drawn 12 mm wide: the default eraser's marks (8 mm at full pressure) stop growing past 1.5 times, so a word erased with little room to spare can show traces at the edge of its erasing after a larger resize (measured: at 2 times with the default eraser, the loop bottoms of a word erased with a few pixels to spare came back). Raising the limit would change what earlier versions draw of the page, so it is left.display.darkand the halo see none. Before, 9 and 45 at 1.1 and 1.5 times (the darkest 151 and 56), and none at 0.6 and 0.4, where the white ink kept its width and so was relatively wider.scale_pagedoes (LASSO-DESIGN.md row 4).A lasso round only erased ink selects nothing (#205)
Before. The lasso takes every ink stroke inside it, and ink erased wholly stays in the page file under its erasing until compaction, so a lasso round only such ink selected it: no halo since #187, a box round nothing, and a bar whose Copy copied nothing.
Now.
plan_shows(rust/src/editor/select.rs) tells whether the page shows any of the ink a lasso takes, its strokes taken whole and its exact-area pieces, by the halo's own rule:shown_of, the one function both use (the page as drawn,stroke_shown_runs, else the estimate). In other words: would the selection have a halo anywhere. What the preview found for the page as it is is read first; the first stroke that shows ends it. When none shows and no link comes with it, the lasso selects nothing and says "Nothing to select.", the toast of a lasso round empty paper. The bar's mode button does the same when the lasso judged again in the other mode takes only such ink (the selection goes, Select mode stays).Tests, and how each was shown to fail
test_lassoa_resize_scales_widths_with_the_group(new): a word erased by two passes of a 3 mm eraser with a pixel or two to spare, a line cut by a 2 mm eraser and a line cut by five strokes of white ink, lifted and put down at 1.1, 1.5, 2 and 0.5 times: no pixel of the word more than 6 levels off the paper (the halo's measure), each cut k times its width within 4 px, the ink and the eraser k times as wide; enlarged over a marker line outside the group, the floor is scoped, the page is never lighter than it was, and the word adds nothing over the line; widths clamped to 0.1 and 12 mm, markers untouched, and a page of scaled strokes reads back with the same parameters. With the scaling taken out it fails 19 checks: 23, 307 and 921 pixels of the word at 1.1, 1.5 and 2 times, the white ink's cut 8 px where 48 and 64 are right, the eraser's cut 20 px where 10 is right at half size.z_lasso_28_resize_erased(new): a word erased by the precise eraser, a marker line cut by it and a line cut by white fountain pen, with a line the lasso leaves out. 1.1 times (halo 3, no dark pixel at the word or either gap, with the selection and after Done), 1.5 times (the same, the floor scoped over the line left out, which still shows), smaller again to 1.2 times over that scoped floor, and half size (the marker line beside its cut still shows); each undone withpage_sig_same1. On e018fc6 it fails 11 checks: the halo 4 for 3 three times; about 230, 10, 1,460, 121, 640 and 135 dark pixels at erased places; 0 for the ink beside the cut, both sides.z_lasso_29_erased_only(new): a lasso round a word the precise eraser took away and round one white ink covers (nothing selected, "Nothing to select.", no box drawn), round empty paper (as before), round a word that shows and an erased one (both selected, Delete takes both, Undo), round the erased word in exact area, and the mode button judging a lasso again into only the erased word. Withplan_showsanswering true it fails 13 checks (selected 1 for 0 four times, a box of 710 dark pixels round the erased word); on e018fc6 the same 13. With only the mode button's check taken out it fails its last 3.z_lasso_30_erased_link(new): ink erased wholly inside a link's area, lassoed: the link comes and the selection stays. With links no longer keeping the selection it fails 3 checks.z_lasso_23_erased_marks(changed): its lasso round the erased word alone now selects nothing (fails 3 checks withplan_showsanswering true); its check that a moved selection's halo is found once at each place moves the erased word with the word above it (halo_found2, 4 and 4,drag_inked1), since a selection of only such ink can no longer be made.z_lasso_24_erased_marks_whole(changed): a lasso where the stroke eraser took a word away says "Nothing to select." (as before; it passes on e018fc6 too).Gate
GRIMOIRE_TEST_PORT=9997 caffeinate -i make -j8 checkon this head (3d9a1b9) passed: make's own last line is "CHECK PASSED" (exit 0), the line before it "RUST CHECK PASSED"; 538 scenario runs (the 8 late ones among them) and 209 language runs, none failed. The Kindle binary is 11,432,208 bytes (guard 13,000,000; 11,429,136 at #203's head) and Grimoire.zip 5,962,635 bytes (guard 7,000,000).For the owner
Closes #204
Closes #205
🤖 Generated with Claude Code
https://claude.ai/code/session_01Uoe9ZJNyEZYoc4bsjqbSyQ