Skip to content

feat(crop): a custom W:H slice on the aspect dial (#542) - #597

Merged
KnifeLemon merged 1 commit into
KnifeLemon:mainfrom
cre8ive-marketing:feat/542-custom-ratio
Oct 26, 2026
Merged

KnifeLemon merged 1 commit into
KnifeLemon:mainfrom
cre8ive-marketing:feat/542-custom-ratio

Conversation

@cre8ive-marketing

Copy link
Copy Markdown
Collaborator

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.

  • Picking it shows two boxes, W and H, beside the ratio button. Type 4 × 5 or 1080 × 1350; only the ratio counts. Resizing to exact pixels stays a preset's job.
  • The slice and the button show the ratio as small as it goes: 1080 × 1350 shows as 4:5. It starts at 2:1, a ratio no other slice has, so it doesn't look like 5:4 turned upright.
  • It's taken as typed, whatever way the picture stands, and the hub (X) turns it. It's kept for the batch like the other ratios (feat(crop): the picked ratio carries on through a batch (#542) #581), while the crop window is open, with no setting.
  • Typing a new number starts the frame over, as large as the new ratio fits, centred. Otherwise a digit at a time (1080 × 5 on the way to 1080 × 1350) would shrink it to nothing.
  • Keys: arrows and letters typed in the boxes are the boxes', so R doesn't reset and the arrows don't nudge the frame. Enter still saves and Escape still closes.
  • New strings in all 17 languages (with German): crop.aspect_custom (the slice's tooltip), crop.custom_width and crop.custom_height (the boxes' names).

The custom slice at 1080 × 1350

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: OuterRadius goes from 118 to 132. Every_language_fits_its_longest_one_word_ratio_name_on_a_slice_without_breaking_it measures every language on eight slices now, and passes. I also updated the MinLabelSize comment as you suggested: it's the embedded Noto Sans everywhere.

The Looks screenshots now include pl, ne and de:

ru ru pl pl
ne ne de de
hi (dark) hi ar ar

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;
    • the swappable list now includes custom.
  • 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.
  • The label-fit test on eight slices, and the dial screenshots with pl, ne and de.
  • dotnet format --verify-no-changes is clean.
  • Full dotnet test: Platform 81, Core 602, CLI 30, Setup 181, Engines 1822 and App 1380 pass, none fail.

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.
@cre8ive-marketing

Copy link
Copy Markdown
Collaborator Author

@KnifeLemon, CI is green on every check here. When you have reviewed it, could you merge it into main?

@KnifeLemon KnifeLemon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@KnifeLemon
KnifeLemon merged commit fd71550 into KnifeLemon:main Oct 26, 2026
9 checks passed
@cre8ive-marketing
cre8ive-marketing deleted the feat/542-custom-ratio branch October 26, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants