Repository navigation
In review
Labels
missing featureThe reference application has it and we don't, or only in part
Description
TL;DR: With "Choose an object" on, dragging a rectangle on the canvas should apply the adjustment to the object inside it, or say that none was found.
What happens today (main 291f972)
- No Choose an object mode exists: the options-bar button is greyed (
crates/ui-egui/src/tools/adjustment_brush.rs:151-153), and a drag paints a brush stroke (paint.adjustmentBrush,crates/engine-paint/src/cmd/adjustment_brush_cmds.rs:164-241). - Object Selection's rectangle search exists:
select.object {"rect": [x, y, w, h]}(crates/engine-core/src/cmd/smartselect_cmds.rs:603-628, GrabCut incrates/algo/src/segment/grabcut.rs). When it finds nothing it answerschanged: falsewithout an alert.
Reference application (measured)
Test document: 800x600 RGB/8, a flat grey Background, a pixel layer "Scene" (light grey) with a dark blue disc (about 130..370 x 180..420) and an orange square (500..700 x 200..400).
- With the button on, dragging draws a dashed rectangle marquee with a W/H readout of its width and height in pixels.
- Release around the orange square (about 473..733 x 167..437 in document pixels): the square is added to the mask (a new adjustment layer, or the active adjustment-brush layer, as for a click); the mask covers exactly the square; history "Adjustment Brush"; the button turns off afterwards.
- Release with no object inside (a rectangle inside the flat square, no edge in it): a modal alert with a warning icon, a message saying that no object was found and that the edge contrast may be too low or the object too small, an OK button and a "Don't show again" checkbox. After OK a history state "Adjustment Brush" remains, the mask is unchanged and the button stays on.
Not measured: modifier keys during the drag; a rectangle holding two objects; other colour modes. These cases keep today's behaviour.
Done when
- With the button on, a drag shows a dashed rectangle with a W/H readout in pixels.
- Release around the orange square (about 473..733 x 167..437 in the test document): the square is 255 in the mask and nothing outside it, one history state, button off.
- Release with no object inside: the alert with OK and "Don't show again" (once ticked, it no longer shows); one history state "Adjustment Brush", mask unchanged, button stays on.
- Drivable without the UI (for example a
rectparameter onpaint.adjustmentBrush). - Builds on MISSING-FEATURE-ADJUSTMENT-BRUSH-CHOOSE-OBJECT #17619 (the toggle itself).
Where
crates/ui-egui/src/tools/adjustment_brush.rscrates/engine-paint/src/cmd/adjustment_brush_cmds.rscrates/algo/src/segment/grabcut.rs(reuse only; change it only if needed)- New test file:
crates/engine-paint/src/cmd/adjustment_brush_choose_rect_tests.rs
Related
- MISSING-FEATURE-ADJUSTMENT-BRUSH-CHOOSE-OBJECT #17619: the toggle, hover and click; this item needs it.
- Otherwise none found (searched "adjustment brush object", "choose an object adjustment").
Rules for this item
- Part of EPIC-TOOLBAR #11374 (EPIC-TOOLBAR). Comment here when you take it and open a draft PR early that says
Fixes #<this issue>. - Put your tests in the new test file named above, and touch only the files under "Where".
- Cases marked not measured keep today's behaviour. Ask here instead of guessing.
- Don't edit
docs/ui-parity.mdor other parity docs. The epic updates them once for all items.
Metadata
Metadata
Assignees
Labels
missing featureThe reference application has it and we don't, or only in part
Activity
hnoerenberg commentedon Dec 3, 2026
Taking this one. Plan: a rect parameter on
paint.adjustmentBrushthat runs the Object Finder search over the dragged rectangle and fills the found object into the adjustment mask, the same path the existing point click uses; the options-bar button stays the toggle. Tests incrates/engine-paint/src/cmd/adjustment_brush_choose_rect_tests.rs.This builds on the Choose-an-object work in #19937, so the branch starts from
feat/adjustment-brush-choose-object-17619rather than main.davidmann4 commentedon Dec 4, 2026
Hi @hnoerenberg, thanks for planning this one out. I'm picking it up to carry it to the end in #20602, built on top of your #19937 branch (your commits stay as they are) and following the plan you described: a
rectparameter onpaint.adjustmentBrush, tests inadjustment_brush_choose_rect_tests.rs. If you already have work on this locally, please say so and I'll fold it in; your review is very welcome.Adjustment Brush: Choose an object by dragging a rectangle (storytold…
Choose an object rectangle: review fixes (storytold#17620)