From 772dfb9e7ee9abe45c9142e2eb018c2e8d40ee17 Mon Sep 17 00:00:00 2001 From: David Mann Date: Thu, 15 Oct 2026 00:04:09 +0200 Subject: [PATCH] Options bar: Brush and Eraser size go to 5000 px in every theme (#5708) (#5709) Options bar: Brush and Eraser size go to 5000 px in every theme (#5708) Also covers the same fix as #5724; thanks to its author. Co-authored-by: nrq6993-a11y <342501791+nrq6993-a11y@users.noreply.github.com> --- crates/ui-egui/src/brush_panel_tests.rs | 15 +++++++++++++++ crates/ui-egui/src/panels.rs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/brush_panel_tests.rs b/crates/ui-egui/src/brush_panel_tests.rs index cffbb5b534..670f442be2 100644 --- a/crates/ui-egui/src/brush_panel_tests.rs +++ b/crates/ui-egui/src/brush_panel_tests.rs @@ -399,6 +399,21 @@ fn brush_mode_dropdown_shows_outside_the_pro_themes() { assert_eq!(j[n].0, "tools.setBrush"); } +#[test] +fn brush_and_eraser_size_fields_keep_sizes_above_2500_px() { + // #5708: outside the Pro themes the Size field capped at 2500 px and clamped a bigger brush + // (set from the picker or `]`) on the next frame; Photoshop and the engine allow 5000 px. + for tool in [crate::state::Tool::Brush, crate::state::Tool::Eraser] { + let mut h = options_bar_harness(tool); + let n = h.state().session.journal.len(); + h.state_mut().session.tools.brush.size = 4000.0; + h.run_steps(4); + assert_eq!(h.state().session.tools.brush.size, 4000.0, "{tool:?}"); + let j = &h.state().session.journal; + assert_eq!(j.len(), n, "showing the bar issues nothing: {:?}", &j[n..]); + } +} + #[test] fn airbrush_smoothing_options_and_symmetry_buttons_work() { // #1177: in the default (Photoshop) theme these options-bar buttons did nothing. diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 82c2b667a1..156a0a3f23 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -1044,7 +1044,7 @@ pub fn options_bar(app: &mut PhotocraftApp, ui: &mut egui::Ui) { let block = crate::eraser_ui::block_mode(app, app.ui.tool); ui.add_enabled_ui(!block, |ui| { opt_label(ui, tl!("Size")); - widgets::value_field(ui, &mut b.size, 1.0..=2500.0, "px", 76.0); + widgets::value_field(ui, &mut b.size, 1.0..=photocraft_engine::paint::MAX_BRUSH_SIZE, "px", 76.0); }); widgets::vline(ui, 22.0); if app.ui.tool == Tool::Eraser {