Repository navigation
feat(crop): a custom W:H slice on the aspect dial (#542) - #597
Conversation
An eighth slice, after 16:9: a ratio typed as W and H in two boxes beside the ratio button, while it's the one in use (4 x 5 or 1080 x 1350; only the ratio counts). The slice and the button show it as small as it goes (1080 x 1350 is 4:5). It is taken as typed whatever way the picture stands, the hub turns it, and it's kept for the batch like the other ratios, while the crop window is open. Typing a new number starts the frame over as large as the ratio fits. Arrow keys and letters typed in the boxes are the boxes', not the window's shortcuts. The dial is wider (outer radius 132) so the eight slices' names still fit: the label test checks every language on eight slices, and the dial screenshots now include pl, ne and de. Strings in all 17 languages.
|
@KnifeLemon, CI is green on every check here. When you have reviewed it, could you merge it into main? |
KnifeLemon
left a comment
There was a problem hiding this comment.
Thanks @cre8ive-marketing, this matches the plan in #542. The custom slice turns with the hub, stays for the batch, and the W/H boxes keep R and the arrows to themselves while Enter and Esc still work. I typed into the boxes to check the edges: 0, negative, too large and non-numeric input are all refused and the box goes back to the last value, and Enter straight after typing saves with the new ratio. The label test now measures every language on eight slices and passes, and the ru/pl/ne/de screenshots show the long names fit at the wider radius. CI is green.
One small thing for later, not needed here: an emptied box stays blank after you leave it while the ratio keeps the last number, so showing that number again would be clearer. Merging.
Part 2 of the #542 follow-ups, as agreed there (after #581).
What it does
An eighth slice on the aspect dial, after 16:9: a custom ratio.
4×5or1080×1350; only the ratio counts. Resizing to exact pixels stays a preset's job.crop.aspect_custom(the slice's tooltip),crop.custom_widthandcrop.custom_height(the boxes' names).Eight slices: every language's labels still fit
A slice is narrower with eight than with seven, and Russian's "Произвольные" already needed 8.7 px on seven. So the dial is wider:
OuterRadiusgoes from 118 to 132.Every_language_fits_its_longest_one_word_ratio_name_on_a_slice_without_breaking_itmeasures every language on eight slices now, and passes. I also updated theMinLabelSizecomment as you suggested: it's the embedded Noto Sans everywhere.The
Looksscreenshots now include pl, ne and de:The others are in the same commit: en, en dark, ko, ko dark, ar dark, fr, pt-BR, pt-PT.
Tests
CropMathTests:A_custom_ratio_is_the_typed_w_over_h_shown_as_small_as_it_goes: 1080 × 1350 is 0.8 and shows as 4:5, it turns to 5:4, an emptied box counts as 1, and no ratio yet is free, never 1 / 0;CropOverlayTests.A_custom_ratio_crops_at_the_typed_w_by_h_and_keeps_it_for_the_batch: on a landscape picture, the slice and the button show 4:5 and the frame is 800 × 1000. The hub turns it to 5:4, and the next (upright) picture keeps it, as large as it fits. It also saves the screenshot above.CropOverlayTests.Typing_in_the_custom_boxes_leaves_the_shortcuts_alone: R and → typed in the W box neither reset the ratio nor move the frame.dotnet format --verify-no-changesis clean.dotnet test: Platform 81, Core 602, CLI 30, Setup 181, Engines 1822 and App 1380 pass, none fail.