Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Merge main into feat/zoom-animation-566

Gustavo Ziger41a75d8a1ce8
diff --cc crates/ui-egui/src/canvas.rs
index 87369c415,7beaa0893..1cbf146be
--- a/crates/ui-egui/src/canvas.rs
+++ b/crates/ui-egui/src/canvas.rs
@@@ -3472,14 -3398,10 +3483,14 @@@ pub fn canvas_view(app: &mut Photocraft
let click_mods = ui.input(|i| pointer_button_modifiers(&i.events, click_button)).unwrap_or(mods);
let d = xf.to_doc(p);
match tool {
- Tool::Zoom => {
+ Tool::Zoom if !transform_owns_pointer => {
let nz = crate::zoom_levels::step(view.zoom, if zoom_out(click_mods.alt) { -1 } else { 1 }, view.doc_size);
let center = app.session.prefs().tools.zoom_clicked_point_to_center;
+ let doc_anchor = xf.to_doc(p);
+ let screen_anchor = p;
zoom_about(&mut view, &xf, p, nz, center, ppp);
+ view.request_zoom_animation(app.session.prefs().general.animated_zoom && nz != display_view.zoom);
+ view.zoom_anchor = (view.zoom_animating && !center).then_some((doc_anchor, [screen_anchor.x, screen_anchor.y]));
}
// A click with the (temporary) Hand does nothing, never the tool underneath.
Tool::Hand | Tool::RotateView => {}
diff --cc crates/ui-egui/src/panels.rs
index 694e5e48c,2aae1c55e..a4aae1508
--- a/crates/ui-egui/src/panels.rs
+++ b/crates/ui-egui/src/panels.rs
@@@ -1929,32 -1931,33 +1949,37 @@@ fn navigator(app: &mut PhotocraftApp, u
let controls = ui.vertical(|ui| {
ui.add_space(4.0);
ui.horizontal(|ui| {
- label(ui, crate::i18n::tr_ctx(crate::i18n::current(), "navigator", "Zoom"));
- ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
- for (lbl, z) in [("200%", 2.0), ("100%", 1.0)] {
- if widgets::pill_tab(ui, lbl, (v.zoom - z).abs() < 1e-3).clicked() {
- app.ui.views[idx].zoom = z;
- app.ui.views[idx].request_zoom_animation(app.session.prefs().general.animated_zoom);
- app.ui.views[idx].zoom_anchor = None;
- app.ui.views[idx].fit_pending = false;
- }
+ ui.spacing_mut().item_spacing.x = 4.0;
- let set = |app: &mut PhotocraftApp, zoom: f32| {
- app.ui.views[idx].zoom = crate::zoom_levels::clamp(zoom, v.doc_size);
++ let set = |app: &mut PhotocraftApp, zoom: f32, animate: bool| {
++ let target = crate::zoom_levels::clamp(zoom, v.doc_size);
++ if target != app.ui.views[idx].zoom {
++ app.ui.views[idx].zoom = target;
++ app.ui.views[idx].request_zoom_animation(animate && app.session.prefs().general.animated_zoom);
+ }
- if widgets::pill_tab(ui, tl!("Fit"), false).clicked() {
- app.ui.views[idx].fit_pending = true;
- app.ui.views[idx].request_zoom_animation(app.session.prefs().general.animated_zoom);
- app.ui.views[idx].zoom_anchor = None;
- }
- });
+ app.ui.views[idx].fit_pending = false;
+ };
+ let mut pct = v.zoom * 100.0;
+ let field = widgets::compact_wrapping_value_field(ui, &mut pct, crate::zoom_levels::percent_range(&app.ui.views[idx]), "%", vec2(64.0, NAV_ROW_H));
+ if field.changed() {
- set(app, pct / 100.0);
++ set(app, pct / 100.0, false);
+ }
+ let out = crate::brush_picker::named(icons::button(ui, "minus", NAV_ROW_H, false, tl!("Zoom Out")), "Zoom Out");
+ if out.clicked() {
- set(app, crate::zoom_levels::step(v.zoom, -1, v.doc_size));
++ set(app, crate::zoom_levels::step(v.zoom, -1, v.doc_size), true);
+ }
+ // The whole zoom range, and always the current zoom: a narrower slider would pull it back.
+ let (lo, hi) = (crate::zoom_levels::min(v.doc_size).min(v.zoom).log2(), crate::zoom_levels::MAX.max(v.zoom).log2());
+ let mut lz = v.zoom.log2();
+ let slider_w = (ui.available_width() - NAV_ROW_H - 4.0).max(60.0);
+ let slid = ui.allocate_ui(vec2(slider_w, NAV_ROW_H), |ui| lz.is_finite() && widgets::slider(ui, &mut lz, lo..=hi, None).changed()).inner;
+ if slid {
- set(app, 2f32.powf(lz));
++ set(app, 2f32.powf(lz), false);
+ }
+ let zin = crate::brush_picker::named(icons::button(ui, "plus", NAV_ROW_H, false, tl!("Zoom In")), "Zoom In");
+ if zin.clicked() {
- set(app, crate::zoom_levels::step(v.zoom, 1, v.doc_size));
++ set(app, crate::zoom_levels::step(v.zoom, 1, v.doc_size), true);
+ }
});
- // The whole zoom range, and always the current zoom: a narrower slider would pull it back.
- let (lo, hi) = (crate::zoom_levels::min(v.doc_size).min(v.zoom).log2(), crate::zoom_levels::MAX.max(v.zoom).log2());
- let mut lz = v.zoom.log2();
- if lz.is_finite() && widgets::slider(ui, &mut lz, lo..=hi, None).changed() {
- app.ui.views[idx].zoom = crate::zoom_levels::clamp(2f32.powf(lz), v.doc_size);
- app.ui.views[idx].zoom_animating = false;
- app.ui.views[idx].zoom_anchor = None;
- app.ui.views[idx].fit_pending = false;
- }
});
// From the preview's bottom, so the spacing above the controls counts too.
let controls = Rect::from_min_max(pos2(frame.left(), frame.bottom()), pos2(frame.right(), controls.response.rect.bottom()));
diff --cc docs/scorecard.md
index 60cd53051,af13a3f26..f2ea9be1e
--- a/docs/scorecard.md
+++ b/docs/scorecard.md
@@@ -7,9 -7,9 +7,9 @@@ Generated by `cargo xtask scorecard` fr
| Area | Done | Partial | Missing | Key numbers |
|---|---:|---:|---:|---|
| [Performance](#performance) | 3 | 22 | 22 | 56 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 17 not run, 5 not measurable yet (baseline 2026-10-05) |
- | [File compatibility](#file-compatibility) | 6 | 13 | 8 | io corpus: oracle ≥ 146/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 236/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 145/256, round trip ≥ 258/256 |
+ | [File compatibility](#file-compatibility) | 7 | 13 | 7 | io corpus: oracle ≥ 146/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 236/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 145/256, round trip ≥ 258/256 |
| [Tools](#tools) | 28 | 14 | 1 | |
-| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 156 (target 0) |
+| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 25 of 156 (target 0) |
| [Type](#type) | 4 | 3 | 2 | |
| [Automation](#automation) | 5 | 2 | 4 | 631 of 631 menu items live (100.0%) |
| [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 28 of 28 crates; panic_hunt present |
diff --cc docs/ui-parity.md
index 1f5565785,f2092fd3e..e699cf2a3
--- a/docs/ui-parity.md
+++ b/docs/ui-parity.md
@@@ -1,6 -1,6 +1,6 @@@
# UI parity: tools, handles, modifiers and feel
- > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-12 · **Change:** minor (Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; animated zoom) · **Target:** Adobe Photoshop 2026
-> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-13 · **Change:** minor (smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows) · **Target:** Adobe Photoshop 2026
++> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-13 · **Change:** minor (smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; animated zoom) · **Target:** Adobe Photoshop 2026
How PhotoCraft's direct manipulation compares with Photoshop 2026 (27.11.0): the toolbox, the
handles and modifier keys of each gesture, nudging, snapping, numeric precision, navigation,