Skip to content

MISSING-FEATURE-ADJUSTMENT-BRUSH-CHOOSE-OBJECT-RECTANGLE #17620

In review

Description

@davidmann4

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 in crates/algo/src/segment/grabcut.rs). When it finds nothing it answers changed: false without 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 rect parameter on paint.adjustmentBrush).
  • Builds on MISSING-FEATURE-ADJUSTMENT-BRUSH-CHOOSE-OBJECT #17619 (the toggle itself).

Where

  • crates/ui-egui/src/tools/adjustment_brush.rs
  • crates/engine-paint/src/cmd/adjustment_brush_cmds.rs
  • crates/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

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.md or other parity docs. The epic updates them once for all items.

Activity

  1. added
    missing feature
    on Nov 29, 2026
  2. hnoerenberg commented on Dec 3, 2026

    @hnoerenberg
    Contributor

    Taking this one. Plan: a rect parameter on paint.adjustmentBrush that 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 in crates/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-17619 rather than main.

  3. davidmann4 commented on Dec 4, 2026

    @davidmann4
    ContributorAuthor

    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 rect parameter on paint.adjustmentBrush, tests in adjustment_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    missing feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions