mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-28 17:29:31 +01:00
Merge pull request #2920 from OneSlips/pr/mask-overlay-rule
LR-MASK-OVERLAY: one overlay rule — the overlay shows when it helps, never over a mask's effect
This commit is contained in:
17 files changed
+881
-74
No files matched your search
@@ -324,7 +324,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Brush Stroke",
|
||||
[],
|
||||
None,
|
||||
"{id?: maskId, points: [[x,y],…] normalized, size?: fraction of long edge (0.03), feather?, flow?, density?, erase?: bool, autoMask?: bool, pressure?: [p,…] pen pressure 0..1 per point (scales each dab's size and flow; omitted: full), connect?: bool — start from the last point of the mask's last stroke (⇧-click), size / feather / flow tapering from that stroke's to these} → {activeMask, connected}",
|
||||
"{id?: maskId, points: [[x,y],…] normalized, size?: fraction of long edge (0.03), feather?, flow?, density?, erase?: bool, autoMask?: bool, pressure?: [p,…] pen pressure 0..1 per point (scales each dab's size and flow; omitted: full), connect?: bool — start from the last point of the mask's last stroke (⇧-click), size / feather / flow tapering from that stroke's to these, continue?: bool — the stroke being painted, sent again as it grows: it replaces the mask's last stroke, so its effect shows while painting} → {activeMask, connected}",
|
||||
has_active,
|
||||
|s, p| {
|
||||
let pts: Vec<Point> = p
|
||||
@@ -347,6 +347,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
pressure: pressure_list(p.get("pressure"), pts_len)?,
|
||||
};
|
||||
let connect = bool_or(p, "connect", false);
|
||||
let again = bool_or(p, "continue", false);
|
||||
let mut connected = false;
|
||||
let next = s.active().and_then(|id| s.develop_of(id)).map(|d| d.next_mask_id()).unwrap_or(1);
|
||||
let want = optional_mask_id(p, "mask.brushStroke")?.or(s.active_mask);
|
||||
@@ -384,7 +385,11 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
strokes.extend(connected_strokes(from, &last, stroke));
|
||||
connected = true;
|
||||
}
|
||||
None => strokes.push(stroke),
|
||||
// the stroke being painted, sent again as it grew: it replaces itself
|
||||
None => match strokes.last_mut() {
|
||||
Some(last) if again => *last = stroke,
|
||||
_ => strokes.push(stroke),
|
||||
},
|
||||
}
|
||||
} else {
|
||||
m.components.push(MaskComponent {
|
||||
|
||||
@@ -508,6 +508,24 @@ fn connected_brush_strokes_start_where_the_last_one_ended() {
|
||||
assert_eq!(strokes(&s).len(), 2);
|
||||
}
|
||||
|
||||
/// A stroke sent again as it grows (its effect shows while painting) replaces itself; earlier strokes stay.
|
||||
#[test]
|
||||
fn a_stroke_sent_again_as_it_grows_replaces_itself() {
|
||||
let mut s = demo();
|
||||
s.execute("mask.add", &json!({"kind": "brush"})).unwrap();
|
||||
s.execute("mask.brushStroke", &json!({"points": [[0.1, 0.1]]})).unwrap();
|
||||
s.execute("mask.brushStroke", &json!({"points": [[0.2, 0.2], [0.3, 0.2]]})).unwrap();
|
||||
for n in [3, 4] {
|
||||
let pts: Vec<[f64; 2]> = (0..n).map(|i| [0.2 + 0.1 * i as f64, 0.2]).collect();
|
||||
s.execute("mask.brushStroke", &json!({"points": pts, "continue": true})).unwrap();
|
||||
}
|
||||
let dev = active_dev(&s);
|
||||
let Some(lightcraft_develop::MaskShape::Brush { strokes }) = dev.masks.first().and_then(|m| m.components.first()).map(|c| &c.shape) else {
|
||||
panic!("a brush mask")
|
||||
};
|
||||
assert_eq!(strokes.iter().map(|s| s.points.len()).collect::<Vec<_>>(), vec![1, 4], "the earlier stroke stays, the live one is replaced");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_mask_id_at_the_limit_does_not_overflow_the_next_masks() {
|
||||
let mut s = demo();
|
||||
|
||||
+46
-11
@@ -201,6 +201,19 @@ impl LightcraftApp {
|
||||
}
|
||||
}
|
||||
|
||||
/// End a Brush stroke being painted, if one is: what already went to the photo stays (its undo step is
|
||||
/// closed), what didn't is dropped. The pointer still held paints nothing more until it is let go.
|
||||
/// Other gestures are left alone.
|
||||
pub(crate) fn cancel_brush_gesture(&mut self) {
|
||||
let Some(crate::panels::detail::Gesture::Brush { live, .. }) = &self.gesture else { return };
|
||||
let went_live = live.is_some();
|
||||
self.gesture = None;
|
||||
self.brush_live = None;
|
||||
if went_live {
|
||||
let _ = self.session.execute("develop.endInteraction", &serde_json::json!({}));
|
||||
}
|
||||
}
|
||||
|
||||
/// Run a UI or engine command by id. The single entry point for every frontend path.
|
||||
pub fn run(&mut self, id: &str, params: Value) -> Result<Value, String> {
|
||||
self.run_typed(id, params).map_err(|e| e.message)
|
||||
@@ -209,6 +222,13 @@ impl LightcraftApp {
|
||||
/// [`LightcraftApp::run`], keeping what kind of error a refusal is: for code that decides on it
|
||||
/// (offer a model's download, treat a cancel as one) instead of reading the message.
|
||||
pub fn run_typed(&mut self, id: &str, params: Value) -> Result<Value, CommandError> {
|
||||
// a brush stroke being painted belongs to the mask and photo it started on: picking another (also by
|
||||
// stepping through the photos with the arrow keys) ends it first, so its next live update or its release
|
||||
// can't land on the one picked; so does Undo, which takes the live stroke away (the next update would
|
||||
// otherwise replace the stroke before it)
|
||||
if brush_stroke_ends_before(id) {
|
||||
self.cancel_brush_gesture();
|
||||
}
|
||||
// (seen before and after each command, so a selection changed and changed back between two
|
||||
// UI passes still counts as changed)
|
||||
self.selection_changes();
|
||||
@@ -271,15 +291,12 @@ impl LightcraftApp {
|
||||
{
|
||||
self.ui.tool.clear();
|
||||
}
|
||||
if r.is_ok() && id == "mask.adjust" {
|
||||
// Judge local adjustments on the photo, without the selection overlay obscuring them.
|
||||
// Keep it hidden after release; O / the overlay eye can show it again.
|
||||
self.ui.mask_overlay = false;
|
||||
}
|
||||
if r.is_ok() && matches!(id, "mask.add" | "mask.addComponent" | "mask.duplicate" | "mask.select") {
|
||||
// A new or newly picked mask shows its overlay again, as in Lightroom: hidden by a slider
|
||||
// drag above, it stayed hidden while the Overlay menu still named a mode (issue #1800).
|
||||
self.ui.mask_overlay = true;
|
||||
// (a mask's sliders don't switch the overlay off, and creating or picking a mask doesn't
|
||||
// switch it on: one rule decides when it shows, see `panels::detail::overlay_mask`)
|
||||
if r.is_ok() && !self.ui.mask_overlay_hidden.is_empty() {
|
||||
// a mask an undo, a history step or pasted settings took away frees its id for the next new
|
||||
// mask: whether O hid its overlay goes with it
|
||||
crate::panels::masking::forget_missing_overlays(self);
|
||||
}
|
||||
if r.is_ok() {
|
||||
// These commands finish synchronously, so their completion would otherwise
|
||||
@@ -583,8 +600,8 @@ impl LightcraftApp {
|
||||
ctx.request_repaint();
|
||||
}
|
||||
if let Some(mask) = polled.refine {
|
||||
// a new selection from a click or a description: show it, as `run` does for new masks
|
||||
self.ui.mask_overlay = true;
|
||||
// (a new selection from a click or a description shows by the overlay rule while its
|
||||
// mask has no settings: `panels::detail::overlay_mask`)
|
||||
self.ui.detail_due = Some((now + 0.3, mask));
|
||||
}
|
||||
if let Some(e) = polled.messages.into_iter().last() {
|
||||
@@ -781,3 +798,21 @@ pub(crate) fn sam_download_ended(download: &lightcraft_engine::segment::Download
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Commands that end a Brush stroke being painted before they run ([`LightcraftApp::run_typed`]): the ones that pick
|
||||
/// another mask or photo, and Undo / Redo, which change the strokes under it.
|
||||
pub(crate) fn brush_stroke_ends_before(id: &str) -> bool {
|
||||
matches!(
|
||||
id,
|
||||
"mask.select"
|
||||
| "library.select"
|
||||
| "library.next"
|
||||
| "library.previous"
|
||||
| "library.up"
|
||||
| "library.down"
|
||||
| "slideshow.next"
|
||||
| "slideshow.previous"
|
||||
| "edit.undo"
|
||||
| "edit.redo"
|
||||
)
|
||||
}
|
||||
@@ -441,6 +441,8 @@ impl LightcraftApp {
|
||||
self.ui.note_right();
|
||||
// panels set it again this frame while the pointer rests on a preset or profile
|
||||
self.hover_preview = None;
|
||||
// (and the mask pin or component row under the pointer: the overlay shows that mask)
|
||||
self.ui.mask_hover_prev = self.ui.mask_hover.take();
|
||||
self.end_drags(&ctx);
|
||||
if self.ui.fullscreen {
|
||||
// full-screen preview: the photo alone on black
|
||||
@@ -465,6 +467,7 @@ impl LightcraftApp {
|
||||
// host frames, and resetting it above must only hide it from this pass's dialogs.
|
||||
panels::notices::restore_prompt_pointer(self, &ctx);
|
||||
}
|
||||
self.repaint_on_mask_hover_change(&ctx);
|
||||
(self.next_widgets, self.next_widget_hits) = widgets::take_registries(&ctx);
|
||||
self.end_frame(&ctx, t0);
|
||||
return;
|
||||
@@ -512,10 +515,20 @@ impl LightcraftApp {
|
||||
// frames, and resetting it above must only hide it from this pass's dialogs.
|
||||
panels::notices::restore_prompt_pointer(self, &ctx);
|
||||
}
|
||||
self.repaint_on_mask_hover_change(&ctx);
|
||||
(self.next_widgets, self.next_widget_hits) = widgets::take_registries(&ctx);
|
||||
self.text_focus = ctx.egui_wants_keyboard_input();
|
||||
self.end_frame(&ctx, t0);
|
||||
}
|
||||
|
||||
/// The pointer moved onto another mask pin or component row, or off them, this frame: the overlay drawn earlier in the
|
||||
/// frame still showed the last one (it falls back to it while panels set the new one), so one more frame shows
|
||||
/// the new one at once rather than at the next input (CodeRabbit on #2920).
|
||||
pub(crate) fn repaint_on_mask_hover_change(&self, ctx: &egui::Context) {
|
||||
if self.ui.mask_hover != self.ui.mask_hover_prev {
|
||||
ctx.request_repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Import commits batches at most once per host frame. The first layout pass and a hidden
|
||||
|
||||
@@ -100,6 +100,10 @@ fn switch_library(app: &mut LightcraftApp, path: &str) -> Result<Value, String>
|
||||
app.ui.reference = None;
|
||||
app.ui.compare = None;
|
||||
app.ui.brief_info = crate::state::BriefInfo::default();
|
||||
// (masks hidden with O, and the hovered mask, are keyed by photo ID too)
|
||||
app.ui.mask_overlay_hidden.clear();
|
||||
app.ui.mask_hover = None;
|
||||
app.ui.mask_hover_prev = None;
|
||||
// a keyword picked in the Keyword List belongs to the library being left
|
||||
app.ui.keyword_list_selected = None;
|
||||
if app.ui.view == crate::state::ViewMode::Reference {
|
||||
|
||||
@@ -811,8 +811,25 @@ fn ui_commands_5(app: &mut LightcraftApp, ctx: &egui::Context, id: &str, p: &Val
|
||||
Ok(Value::Null)
|
||||
}
|
||||
"view.maskOverlay" => {
|
||||
app.ui.mask_overlay = p.get("show").and_then(Value::as_bool).unwrap_or(!app.ui.mask_overlay);
|
||||
Ok(json!({"maskOverlay": app.ui.mask_overlay}))
|
||||
// O shows or hides what is on screen now: an overlay that showed by itself (a mask
|
||||
// without settings yet) is hidden for that mask
|
||||
let selected = app.session.active().and_then(|id| app.session.develop_of(id)).and_then(|d| {
|
||||
app.session
|
||||
.active_mask
|
||||
.and_then(|mid| d.masks.iter().find(|m| m.id == mid).map(|m| (mid, crate::panels::detail::overlay_shown(app, m))))
|
||||
});
|
||||
let shown = selected.is_some_and(|s| s.1) || (selected.is_none() && app.ui.mask_overlay);
|
||||
let show = p.get("show").and_then(Value::as_bool).unwrap_or(!shown);
|
||||
app.ui.mask_overlay = show;
|
||||
let photo = app.session.active();
|
||||
if let Some(key) = selected.and_then(|s| photo.map(|p| (p, s.0))) {
|
||||
// each hidden mask stays hidden until O shows it again (not until another is hidden)
|
||||
app.ui.mask_overlay_hidden.retain(|k| *k != key);
|
||||
if !show {
|
||||
app.ui.mask_overlay_hidden.push(key);
|
||||
}
|
||||
}
|
||||
Ok(json!({"maskOverlay": show}))
|
||||
}
|
||||
"view.maskOverlayAll" => {
|
||||
app.ui.mask_overlay_all = !app.ui.mask_overlay_all;
|
||||
@@ -1106,6 +1123,21 @@ fn ui_commands_8(app: &mut LightcraftApp, _ctx: &egui::Context, id: &str, p: &Va
|
||||
}),
|
||||
s if s.starts_with("tool.") => {
|
||||
let tool = &s["tool.".len()..];
|
||||
// a Brush stroke ends before another tool takes over (its release would go unseen: the next
|
||||
// stroke would carry on from it), and before a Brush request that makes a new mask or component
|
||||
// (what was painted stays on the mask it was painted on); a live one closes its undo step, so a
|
||||
// new mask isn't folded into the "Brush" step
|
||||
let creates = p.get("new").and_then(Value::as_bool) == Some(true) || p.get("op").is_some();
|
||||
if (tool != "brush" || creates)
|
||||
&& let Some(crate::panels::detail::Gesture::Brush { live, .. }) = &app.gesture
|
||||
{
|
||||
let went_live = live.is_some();
|
||||
app.gesture = None;
|
||||
app.brush_live = None;
|
||||
if went_live {
|
||||
let _ = app.run("develop.endInteraction", json!({}));
|
||||
}
|
||||
}
|
||||
match tool {
|
||||
"none" => app.ui.tool.clear(),
|
||||
"guidedUpright" => {
|
||||
@@ -1135,7 +1167,6 @@ fn ui_commands_8(app: &mut LightcraftApp, _ctx: &egui::Context, id: &str, p: &Va
|
||||
return Some(Err(e));
|
||||
}
|
||||
app.ui.brush_erase = false;
|
||||
app.ui.mask_overlay = true;
|
||||
}
|
||||
app.ui.right = RightPanel::Masking;
|
||||
app.ui.view = ViewMode::Detail;
|
||||
|
||||
@@ -76,6 +76,9 @@ pub enum Gesture {
|
||||
/// Pen pressure (0..1) at each point; empty when no pen pressure was reported (a mouse) or the
|
||||
/// brush's Pen Pressure switch is off.
|
||||
pressure: Vec<f32>,
|
||||
/// A stroke whose effect shows while painting: when (app time) it last went to the photo and
|
||||
/// how many points it had then; `None` until it first does (its undo step is open meanwhile).
|
||||
live: Option<(f64, usize)>,
|
||||
},
|
||||
Spot {
|
||||
points: Vec<Point>,
|
||||
@@ -1167,6 +1170,81 @@ fn targeted_drag(app: &mut LightcraftApp, resp: &egui::Response, map: &CanvasMap
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether a slider is adjusting the photo right now. Then the mask overlay, its lines, handles
|
||||
/// and pins hide so the effect itself can be judged, even an overlay switched on with O; they come
|
||||
/// back as they were when the slider is let go. Sliders that shape the mask itself (Refine,
|
||||
/// Smoothness, Feather, a range's edges) keep them.
|
||||
pub(crate) fn adjusting(app: &LightcraftApp) -> bool {
|
||||
app.ui.dragging_control.as_deref().is_some_and(|c| !shapes_graphics(c))
|
||||
}
|
||||
|
||||
/// Slider ids that change what the mask graphics show rather than the photo's look.
|
||||
fn shapes_graphics(id: &str) -> bool {
|
||||
matches!(id, "refine" | "smoothness" | "edge" | "feather")
|
||||
}
|
||||
|
||||
/// The mask the overlay shows, if any. One rule:
|
||||
/// overlay = O / Always, OR (the pointer on the mask's pin or on one of its component rows AND not
|
||||
/// adjusting), OR (Auto AND the mask has no settings). The pointer on the mask's own row (name, eye,
|
||||
/// menu) shows nothing: that is where its effect is judged, the eye switching it on and off. "Adjusting" is a slider at work ([`adjusting`], which hides every
|
||||
/// overlay in [`view_overlay`]) or a mask gesture (a handle or the gradient dragged, a brush
|
||||
/// stroke): hovering never shows the overlay while one runs, even with the pointer over the pin
|
||||
/// being dragged. A mask with settings (its own, or a preset's) never shows by itself, so its effect
|
||||
/// can be judged while it is placed or picked; a mask without settings shows what it selects, also
|
||||
/// while it is drawn (there is no effect to see yet). This replaces showing the overlay again on
|
||||
/// every new, picked or duplicated mask (#1800): that covered the photo exactly when the user
|
||||
/// judges a mask's effect; hovering one of its component rows or its pin, or O, shows it on request.
|
||||
pub(crate) fn overlay_mask<'a>(app: &LightcraftApp, d: &'a DevelopSettings) -> Option<&'a lightcraft_develop::Mask> {
|
||||
if !mask_gesture(app)
|
||||
&& let Some(photo) = app.session.active()
|
||||
&& let Some(m) =
|
||||
app.ui.mask_hover.or(app.ui.mask_hover_prev).filter(|(p, _)| *p == photo).and_then(|(_, id)| d.masks.iter().find(|m| m.id == id))
|
||||
{
|
||||
return Some(m);
|
||||
}
|
||||
let m = app.session.active_mask.and_then(|id| d.masks.iter().find(|m| m.id == id))?;
|
||||
overlay_shown(app, m).then_some(m)
|
||||
}
|
||||
|
||||
/// Whether the selected mask `m`'s overlay shows (without hovering): O / Always, or Auto and `m`
|
||||
/// has no settings ([`overlay_mask`] has the whole rule).
|
||||
pub(crate) fn overlay_shown(app: &LightcraftApp, m: &lightcraft_develop::Mask) -> bool {
|
||||
// (a mask O hid stays hidden though O showed another since)
|
||||
if app.session.active().is_some_and(|photo| app.ui.mask_overlay_hidden.contains(&(photo, m.id))) {
|
||||
return false;
|
||||
}
|
||||
app.ui.mask_overlay || !mask_has_settings(m)
|
||||
}
|
||||
|
||||
/// Whether mask `m` changes the photo by itself: any adjustment off its default. (Its shape, Refine
|
||||
/// Edges included, is not a setting: it is what the overlay is for.)
|
||||
pub(crate) fn mask_has_settings(m: &lightcraft_develop::Mask) -> bool {
|
||||
m.adjust != lightcraft_develop::LocalAdjustments::default()
|
||||
}
|
||||
|
||||
/// Whether a mask is being shaped on the photo right now: a handle or the gradient dragged, a brush
|
||||
/// stroke.
|
||||
pub(crate) fn mask_gesture(app: &LightcraftApp) -> bool {
|
||||
matches!(app.gesture, Some(Gesture::MaskHandle { .. } | Gesture::Brush { .. }))
|
||||
}
|
||||
|
||||
/// Whether the selected mask `m` has an AI selection (an Object click or a description) still
|
||||
/// being computed. Meanwhile no overlay shows for it: a stand-in would look like the result.
|
||||
pub(crate) fn ai_computing(app: &LightcraftApp, m: &lightcraft_develop::Mask) -> bool {
|
||||
app.session.segmenter.busy() && ai_unfinished(m)
|
||||
}
|
||||
|
||||
/// Whether mask `m` has an AI selection without its result yet.
|
||||
fn ai_unfinished(m: &lightcraft_develop::Mask) -> bool {
|
||||
m.components.iter().any(|c| matches!(&c.shape, MaskShape::Prompt { seg: None, .. } | MaskShape::Object { seg: None, .. }))
|
||||
}
|
||||
|
||||
/// Whether the all-masks overlay can show: some visible mask has a shape, and none has an AI
|
||||
/// selection still being computed (`busy`), whose stand-in would look like the result.
|
||||
pub(crate) fn all_masks_showable(d: &DevelopSettings, busy: bool) -> bool {
|
||||
d.masks.iter().any(|m| m.visible && !m.components.is_empty()) && !(busy && d.masks.iter().any(|m| m.visible && ai_unfinished(m)))
|
||||
}
|
||||
|
||||
/// The diagnostic overlay the loupe shows (an Alt-drag preview, the selected mask, Point Color's
|
||||
/// visualized range, Visualize Spots, the clipping warnings).
|
||||
pub(crate) fn view_overlay(app: &LightcraftApp, d: &DevelopSettings) -> lightcraft_pipeline::Overlay {
|
||||
@@ -1181,19 +1259,22 @@ pub(crate) fn view_overlay(app: &LightcraftApp, d: &DevelopSettings) -> lightcra
|
||||
{
|
||||
return o;
|
||||
}
|
||||
// a slider at work: the effect shows, not the overlay (it returns afterwards)
|
||||
let shown = !adjusting(app);
|
||||
// Show every visible mask's region at once (Ctrl+Shift+O / Cmd+Shift+O), ahead of the selected-mask overlay
|
||||
// so the shortcut is not shadowed by the always-on single-mask overlay.
|
||||
if app.ui.right == RightPanel::Masking && app.ui.mask_overlay_all && d.masks.iter().any(|m| m.visible && !m.components.is_empty()) {
|
||||
// so the shortcut is not shadowed by the single-mask overlay.
|
||||
if shown && app.ui.right == RightPanel::Masking && app.ui.mask_overlay_all && all_masks_showable(d, app.session.segmenter.busy()) {
|
||||
return Overlay::AllMasks {
|
||||
view: MaskView::parse(&app.ui.mask_overlay_mode).unwrap_or_default(),
|
||||
color: app.ui.mask_overlay_color,
|
||||
opacity: app.ui.mask_overlay_opacity.clamp(0.0, 100.0).round() as u8,
|
||||
};
|
||||
}
|
||||
if app.ui.right == RightPanel::Masking
|
||||
&& app.ui.mask_overlay
|
||||
&& let Some(m) = app.session.active_mask.and_then(|id| d.masks.iter().find(|m| m.id == id))
|
||||
if shown
|
||||
&& app.ui.right == RightPanel::Masking
|
||||
&& let Some(m) = overlay_mask(app, d)
|
||||
&& !m.components.is_empty()
|
||||
&& !ai_computing(app, m)
|
||||
{
|
||||
return Overlay::Mask {
|
||||
id: m.id.min(u16::MAX as u32) as u16,
|
||||
|
||||
@@ -102,18 +102,18 @@ pub(super) fn lens_blur_brush_overlay(app: &mut LightcraftApp, ui: &mut egui::Ui
|
||||
let force = if app.ui.brush_pressure { ui.input(pen_force) } else { None };
|
||||
match &mut app.gesture {
|
||||
Some(Gesture::Brush { points, .. }) if points.last() == Some(&n) => {}
|
||||
Some(Gesture::Brush { points, pressure }) => {
|
||||
Some(Gesture::Brush { points, pressure, .. }) => {
|
||||
record_pressure(pressure, points.len(), force);
|
||||
points.push(n);
|
||||
}
|
||||
_ => {
|
||||
let mut pressure = Vec::new();
|
||||
record_pressure(&mut pressure, 0, force);
|
||||
app.gesture = Some(Gesture::Brush { points: vec![n], pressure });
|
||||
app.gesture = Some(Gesture::Brush { points: vec![n], pressure, live: None });
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some(Gesture::Brush { points, pressure }) = &app.gesture {
|
||||
if let Some(Gesture::Brush { points, pressure, .. }) = &app.gesture {
|
||||
let screen: Vec<Pos2> = points.iter().map(|q| map.screen(*q)).collect();
|
||||
let params = crate::brush_live::LiveParams {
|
||||
clip,
|
||||
@@ -130,7 +130,7 @@ pub(super) fn lens_blur_brush_overlay(app: &mut LightcraftApp, ui: &mut egui::Ui
|
||||
app.brush_live = None;
|
||||
}
|
||||
if (resp.drag_stopped() || resp.clicked())
|
||||
&& let Some(Gesture::Brush { points, pressure }) = app.gesture.take()
|
||||
&& let Some(Gesture::Brush { points, pressure, .. }) = app.gesture.take()
|
||||
{
|
||||
app.brush_live = None;
|
||||
let pts: Vec<[f64; 2]> = points.iter().map(|q| [q.x, q.y]).collect();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::geometry::CanvasMap;
|
||||
use super::{
|
||||
Color32, DevelopSettings, Gesture, LightcraftApp, MaskShape, Point, Pos2, Rect, Sense, Stroke, StrokeKind, Tokens, ToolOverlay, json, pos2,
|
||||
register, vec2,
|
||||
Color32, DevelopSettings, Gesture, LightcraftApp, MaskShape, Point, Pos2, Rect, Sense, Stroke, StrokeKind, Tokens, ToolOverlay, adjusting, json,
|
||||
overlay_shown, pos2, register, vec2,
|
||||
};
|
||||
|
||||
/// What the user did to a face box this frame.
|
||||
@@ -363,7 +363,12 @@ pub(super) fn color_range_pick(app: &mut LightcraftApp, ui: &egui::Ui, resp: &eg
|
||||
pub(super) fn mask_overlay(app: &mut LightcraftApp, ui: &mut egui::Ui, resp: &egui::Response, map: &CanvasMap, d: &DevelopSettings) {
|
||||
let active = app.session.active_mask;
|
||||
let clip = app.canvas_rect.unwrap_or(map.rect);
|
||||
let p = &ui.painter_at(clip);
|
||||
let mut painter = ui.painter_at(clip);
|
||||
// a slider at work: no lines, handles or pins over the effect
|
||||
if adjusting(app) {
|
||||
painter.set_invisible();
|
||||
}
|
||||
let p = &painter;
|
||||
// (mask, component, handle, screen position) of everything that can be grabbed
|
||||
let mut grips: Vec<(u32, usize, u8, Pos2)> = Vec::new();
|
||||
// pins follow Show Pins and the Tool Overlay mode (Shift+H); Auto hides them while brushing
|
||||
@@ -396,6 +401,15 @@ pub(super) fn mask_overlay(app: &mut LightcraftApp, ui: &mut egui::Ui, resp: &eg
|
||||
}
|
||||
}
|
||||
}
|
||||
// the pointer on a pin shows that mask's overlay (as Lightroom Classic); of pins on top of each other, the
|
||||
// selected mask's, then the nearest: the one a drag there would move ([`grip_gestures`])
|
||||
if let Some(h) = resp.hover_pos()
|
||||
&& let Some((mid, ..)) = grips.iter().filter(|(_, _, handle, q)| *handle == 0 && q.distance(h) < 9.0).min_by(|a, b| {
|
||||
(Some(a.0) != active, a.3.distance(h)).partial_cmp(&(Some(b.0) != active, b.3.distance(h))).unwrap_or(std::cmp::Ordering::Equal)
|
||||
})
|
||||
{
|
||||
app.ui.mask_hover = app.session.active().map(|photo| (photo, *mid));
|
||||
}
|
||||
mask_keys(app, ui, map, d, &grips);
|
||||
object_marks(app, p, map, d, active);
|
||||
// Colour Range "Pick": the Masking panel owns the loupe's clicks (general_interaction
|
||||
@@ -664,6 +678,15 @@ fn brush_tool(
|
||||
clip: Rect,
|
||||
d: &DevelopSettings,
|
||||
) {
|
||||
// a live stroke cut short (no release seen): what went to the photo stays, in one step
|
||||
if matches!(app.gesture, Some(Gesture::Brush { live: Some(_), .. }))
|
||||
&& !resp.drag_stopped()
|
||||
&& !resp.clicked()
|
||||
&& !ui.input(|i| i.pointer.any_down())
|
||||
{
|
||||
app.gesture = None;
|
||||
let _ = app.run("develop.endInteraction", json!({}));
|
||||
}
|
||||
let active = app.session.active_mask;
|
||||
// the stroke goes into the selected mask (or a new one): in its coordinates
|
||||
let map = &map.for_mask_id(d, active);
|
||||
@@ -682,30 +705,39 @@ fn brush_tool(
|
||||
match &mut app.gesture {
|
||||
// a held, unmoving pointer records nothing: coverage builds by passes, not time (#518)
|
||||
Some(Gesture::Brush { points, .. }) if points.last() == Some(&n) => {}
|
||||
Some(Gesture::Brush { points, pressure }) => {
|
||||
Some(Gesture::Brush { points, pressure, .. }) => {
|
||||
record_pressure(pressure, points.len(), force);
|
||||
points.push(n);
|
||||
}
|
||||
// a stroke starts with a press, not part-way through a drag: one ended for picking another mask
|
||||
// or photo ([`LightcraftApp::cancel_brush_gesture`]) paints nothing more until the button is let go
|
||||
_ if !(resp.drag_started() || resp.clicked()) => {}
|
||||
_ => {
|
||||
let mut pressure = Vec::new();
|
||||
record_pressure(&mut pressure, 0, force);
|
||||
app.gesture = Some(Gesture::Brush { points: vec![n], pressure });
|
||||
app.gesture = Some(Gesture::Brush { points: vec![n], pressure, live: None });
|
||||
}
|
||||
}
|
||||
}
|
||||
// the stroke being painted (the render shows it once it's committed), with the committed
|
||||
// stroke's dab spacing, feather and flow (issue #517), tinted only when the overlay will
|
||||
// show it: with the overlay hidden (O, or a mask slider hid it) or a colour overlay at
|
||||
// opacity 0, the photo stays untinted while painting, so dodging and burning is judged on
|
||||
// the photo (issue #2549)
|
||||
// the overlay rule: a mask with settings shows its effect while painted (the stroke goes to the photo live),
|
||||
// never tinted; the stroke is tinted only when the overlay will show it (O, or a mask without settings yet).
|
||||
// With the all-masks overlay it follows the mask's visibility, and a colour overlay at opacity 0 tints nothing,
|
||||
// so dodging and burning is judged on the photo (issue #2549). The tinted stroke has the committed stroke's dab
|
||||
// spacing, feather and flow (issue #517); the render shows it once it's committed.
|
||||
use lightcraft_pipeline::MaskView;
|
||||
let colored = matches!(MaskView::parse(&app.ui.mask_overlay_mode).unwrap_or_default(), MaskView::Color | MaskView::ColorOnBw);
|
||||
// the all-masks overlay ([`view_overlay`]) shows only visible masks, and gives way to the
|
||||
// selected mask's when none has anything in it (a stroke goes into the selected mask, or a new one)
|
||||
let visible = active.and_then(|id| d.masks.iter().find(|m| m.id == id)).is_none_or(|m| m.visible);
|
||||
let mask = active.and_then(|id| d.masks.iter().find(|m| m.id == id));
|
||||
let visible = mask.is_none_or(|m| m.visible);
|
||||
let all = app.ui.mask_overlay_all && (visible || d.masks.iter().any(|m| m.visible && !m.components.is_empty()));
|
||||
let shown = if all { visible } else { app.ui.mask_overlay } && !(colored && app.ui.mask_overlay_opacity <= 0.0);
|
||||
if shown && let Some(Gesture::Brush { points, pressure }) = &app.gesture {
|
||||
let red = if all { visible } else { mask.is_none_or(|m| overlay_shown(app, m)) } && !(colored && app.ui.mask_overlay_opacity <= 0.0);
|
||||
if !red {
|
||||
live_stroke(app, ui);
|
||||
}
|
||||
if let Some(Gesture::Brush { points, pressure, live: None }) = &app.gesture
|
||||
&& red
|
||||
{
|
||||
let screen: Vec<Pos2> = points.iter().map(|q| map.screen(*q)).collect();
|
||||
// opacity 0 only gets here in the image views, which ignore it: a fixed tint there
|
||||
let opacity = if app.ui.mask_overlay_opacity > 0.0 { app.ui.mask_overlay_opacity / 100.0 } else { 110.0 / 255.0 };
|
||||
@@ -724,7 +756,7 @@ fn brush_tool(
|
||||
app.brush_live = None;
|
||||
}
|
||||
if (resp.drag_stopped() || resp.clicked())
|
||||
&& let Some(Gesture::Brush { points, pressure }) = app.gesture.take()
|
||||
&& let Some(Gesture::Brush { points, pressure, live }) = app.gesture.take()
|
||||
{
|
||||
app.brush_live = None;
|
||||
let pts: Vec<[f64; 2]> = points.iter().map(|q| [q.x, q.y]).collect();
|
||||
@@ -736,8 +768,54 @@ fn brush_tool(
|
||||
let _ = app.run(
|
||||
"mask.brushStroke",
|
||||
json!({"points": pts, "size": app.ui.brush_size, "feather": app.ui.brush_feather, "flow": app.ui.brush_flow,
|
||||
"erase": erase, "autoMask": app.ui.brush_auto_mask, "pressure": pressure, "connect": connect}),
|
||||
"erase": erase, "autoMask": app.ui.brush_auto_mask, "pressure": pressure, "connect": connect && live.is_none(),
|
||||
"continue": live.is_some()}),
|
||||
);
|
||||
if live.is_some() {
|
||||
let _ = app.run("develop.endInteraction", json!({}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A stroke on a mask with settings goes to the photo every moment while painting, so its effect
|
||||
/// shows live (one undo step for the whole stroke).
|
||||
fn live_stroke(app: &mut LightcraftApp, ui: &egui::Ui) {
|
||||
let now = ui.input(|i| i.time);
|
||||
let Some(Gesture::Brush { points, pressure, live }) = &app.gesture else { return };
|
||||
if !live_due(*live, points.len(), now) {
|
||||
return;
|
||||
}
|
||||
let (pts, pressure, first) = (points.iter().map(|q| [q.x, q.y]).collect::<Vec<_>>(), pressure.clone(), live.is_none());
|
||||
if first {
|
||||
let _ = app.run("develop.beginInteraction", json!({"label": "Brush"}));
|
||||
}
|
||||
let erase = app.ui.brush_erase != ui.input(|i| i.modifiers.alt);
|
||||
let sent = app.run(
|
||||
"mask.brushStroke",
|
||||
json!({"points": pts, "size": app.ui.brush_size, "feather": app.ui.brush_feather, "flow": app.ui.brush_flow,
|
||||
"erase": erase, "autoMask": app.ui.brush_auto_mask, "pressure": pressure, "continue": !first}),
|
||||
);
|
||||
// only a stroke that reached the photo is live: else the release would replace the mask's
|
||||
// previous stroke instead of adding this one
|
||||
if sent.is_ok() {
|
||||
if let Some(Gesture::Brush { live, .. }) = &mut app.gesture {
|
||||
*live = Some((now, pts.len()));
|
||||
}
|
||||
} else if first {
|
||||
let _ = app.run("develop.endInteraction", json!({}));
|
||||
}
|
||||
ui.ctx().request_repaint_after(std::time::Duration::from_secs_f64(LIVE_STROKE_EVERY));
|
||||
}
|
||||
|
||||
/// How often (seconds) a stroke whose effect shows while painting goes to the photo.
|
||||
const LIVE_STROKE_EVERY: f64 = 0.12;
|
||||
|
||||
/// Whether the stroke of `len` points should go to the photo now: the first time once it has two
|
||||
/// points, then every [`LIVE_STROKE_EVERY`] when it grew.
|
||||
fn live_due(live: Option<(f64, usize)>, len: usize, now: f64) -> bool {
|
||||
match live {
|
||||
None => len >= 2,
|
||||
Some((at, sent)) => len > sent && (now - at >= LIVE_STROKE_EVERY || now < at || now.is_nan()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -196,9 +196,12 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label(egui::RichText::new(crate::i18n::tr("Masks")).font(t.semibold(13.0)).color(t.text_label));
|
||||
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
|
||||
// lit while the overlay is on to stay; a click does what O does
|
||||
let on = app.ui.mask_overlay;
|
||||
if icon_button(ui, "maskOverlay", Icon::Eye, vec2(24.0, 24.0), on, true, "Show overlay (O)").clicked() {
|
||||
app.ui.mask_overlay = !on;
|
||||
if icon_button(ui, "maskOverlay", Icon::Eye, vec2(24.0, 24.0), on, true, "Show overlay (O)").clicked()
|
||||
&& let Err(e) = app.run("view.maskOverlay", json!({}))
|
||||
{
|
||||
app.toast(ui.ctx(), e);
|
||||
}
|
||||
let all = app.ui.mask_overlay_all;
|
||||
let all_mac = ui.ctx().os() == egui::os::OperatingSystem::Mac;
|
||||
@@ -261,6 +264,8 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) {
|
||||
register(ui, format!("maskName:{}", m.id), Rect::from_min_size(at, g.size()));
|
||||
ui.painter().galley(at, g, color);
|
||||
let resp = if elided { resp.on_hover_text(&m.name) } else { resp };
|
||||
// the mask's own row (name, eye, menu) is where its effect is judged, the eye switching it
|
||||
// on and off: the pointer on it shows no overlay (a component row under it does)
|
||||
// show / hide on hover (and always while hidden)
|
||||
// (the pointer test, not `hovered`: over the eye, the row itself no longer counts as hovered)
|
||||
if ui.rect_contains_pointer(r) || !m.visible {
|
||||
@@ -313,7 +318,7 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) {
|
||||
MaskShape::Prompt { text, .. } => format!("“{text}”"),
|
||||
_ => menu_label(kind).to_string(),
|
||||
});
|
||||
ui.horizontal(|ui| {
|
||||
let row = ui.horizontal(|ui| {
|
||||
let (r, _) = ui.allocate_exact_size(vec2(16.0, 16.0), Sense::hover());
|
||||
paint(ui.painter(), r, icon, t.text_label);
|
||||
let op = match c.op {
|
||||
@@ -368,6 +373,10 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) {
|
||||
egui::Popup::menu(&more).show(|ui| component_row_menu(app, ui, m.id, i, &label, m.components.len()));
|
||||
});
|
||||
});
|
||||
// the pointer on a component's row shows the whole mask's overlay, to see where it is
|
||||
if ui.rect_contains_pointer(row.response.rect) {
|
||||
app.ui.mask_hover = app.session.active().map(|photo| (photo, m.id));
|
||||
}
|
||||
range_controls(app, ui, i, &c.shape);
|
||||
}
|
||||
ui.add_space(6.0);
|
||||
@@ -384,7 +393,7 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) {
|
||||
let _ = app.run("mask.invert", json!({}));
|
||||
}
|
||||
if icon_button(ui, "maskDelete", Icon::Trash, vec2(26.0, 24.0), false, true, "Delete mask").clicked() {
|
||||
let _ = app.run("mask.delete", json!({}));
|
||||
delete_mask(app, None);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -509,7 +518,7 @@ fn mask_menu(app: &mut LightcraftApp, ui: &mut egui::Ui, id: u32, name: &str, vi
|
||||
ui.close();
|
||||
}
|
||||
if ui.button(crate::i18n::tr("Delete Mask")).clicked() {
|
||||
let _ = app.run("mask.delete", json!({"id": id}));
|
||||
delete_mask(app, Some(id));
|
||||
ui.close();
|
||||
}
|
||||
}
|
||||
@@ -986,6 +995,25 @@ fn brush_settings(app: &mut LightcraftApp, ui: &mut egui::Ui) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Deletes mask `id` of the active photo (`None`: the active mask). A deleted mask's id is free for the next new
|
||||
/// one, so whether O hid its overlay goes with it.
|
||||
pub(crate) fn delete_mask(app: &mut LightcraftApp, id: Option<u32>) {
|
||||
let (photo, target) = (app.session.active(), id.or(app.session.active_mask));
|
||||
let params = id.map_or_else(|| json!({}), |id| json!({"id": id}));
|
||||
if app.run("mask.delete", params).is_ok()
|
||||
&& let (Some(photo), Some(target)) = (photo, target)
|
||||
{
|
||||
app.ui.mask_overlay_hidden.retain(|k| *k != (photo, target));
|
||||
}
|
||||
}
|
||||
|
||||
/// Forgets that O hid the overlay of a mask that no longer exists (undone, stepped back in the history, replaced by
|
||||
/// pasted settings): its id goes to the next new mask, which must not start hidden.
|
||||
pub(crate) fn forget_missing_overlays(app: &mut LightcraftApp) {
|
||||
let session = &app.session;
|
||||
app.ui.mask_overlay_hidden.retain(|(photo, id)| session.develop_of(*photo).is_some_and(|d| d.masks.iter().any(|m| m.id == *id)));
|
||||
}
|
||||
|
||||
/// The ∩ in front of an intersecting mask component: two legs joined by a half circle, as tall as
|
||||
/// a lowercase letter.
|
||||
fn intersect_mark(painter: &egui::Painter, rect: Rect, color: egui::Color32) {
|
||||
|
||||
@@ -705,7 +705,7 @@ fn delete_key(app: &mut LightcraftApp, ctx: &egui::Context) -> bool {
|
||||
match app.ui.right {
|
||||
R::Masking => {
|
||||
if app.session.active_mask.is_some() {
|
||||
let _ = app.run("mask.delete", json!({}));
|
||||
crate::panels::masking::delete_mask(app, None);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -107,9 +107,23 @@ pub struct UiState {
|
||||
#[serde(skip)]
|
||||
pub proof_intent: lightcraft_engine::proof::ProofIntent,
|
||||
pub proof_paper_ink: bool,
|
||||
/// Masking: show the selected mask as a rendered overlay (O), how (`MaskView` name, ⇧O cycles),
|
||||
/// in which colour and opacity (0..100, colour views), and whether pins are drawn.
|
||||
/// Masking: the selected mask's overlay switched on to stay (O, the panel's eye: "Always"),
|
||||
/// how it is drawn (`MaskView` name, ⇧O cycles), in which colour and opacity (0..100, colour
|
||||
/// views), and whether pins are drawn. Without it the overlay shows only by the one rule of
|
||||
/// [`crate::panels::detail::overlay_mask`]: a mask without settings yet, or the mask whose pin
|
||||
/// or component row the pointer is on. Not kept between sessions: the photo opens without it.
|
||||
#[serde(skip)]
|
||||
pub mask_overlay: bool,
|
||||
/// The mask whose pin or component row the pointer is on, this frame and the last (the overlay
|
||||
/// shows it), with the photo it is on: a mask of the same id on another photo is another mask.
|
||||
/// Not the mask's own row: there its effect is judged.
|
||||
#[serde(skip)]
|
||||
pub mask_hover: Option<(lightcraft_engine::catalog::PhotoId, u32)>,
|
||||
#[serde(skip)]
|
||||
pub mask_hover_prev: Option<(lightcraft_engine::catalog::PhotoId, u32)>,
|
||||
/// The masks (of their photos) whose automatic overlay O hid, each until O shows it again.
|
||||
#[serde(skip)]
|
||||
pub mask_overlay_hidden: Vec<(lightcraft_engine::catalog::PhotoId, u32)>,
|
||||
pub mask_overlay_mode: String,
|
||||
pub mask_overlay_color: [u8; 3],
|
||||
pub mask_overlay_opacity: f32,
|
||||
@@ -554,7 +568,10 @@ impl Default for UiState {
|
||||
proof_profile: None,
|
||||
proof_intent: lightcraft_engine::proof::ProofIntent::Perceptual,
|
||||
proof_paper_ink: false,
|
||||
mask_overlay: true,
|
||||
mask_overlay: false,
|
||||
mask_hover: None,
|
||||
mask_hover_prev: None,
|
||||
mask_overlay_hidden: Vec::new(),
|
||||
mask_overlay_mode: "color".into(),
|
||||
mask_overlay_color: [230, 30, 40],
|
||||
mask_overlay_opacity: 50.0,
|
||||
|
||||
@@ -119,7 +119,9 @@ fn new_brush_starts_a_separate_mask_in_paint_mode() {
|
||||
click(&mut h, "maskNew:brush");
|
||||
assert_eq!(h.app.session.active_mask, Some(2));
|
||||
assert!(!h.app.ui.brush_erase);
|
||||
assert!(h.app.ui.mask_overlay);
|
||||
// a new mask has no settings: its overlay shows by itself (O stays as it was)
|
||||
assert!(!h.app.ui.mask_overlay);
|
||||
assert_eq!(crate::panels::detail::overlay_mask(&h.app, &develop(&h)).map(|m| m.id), Some(2));
|
||||
let r = h.request("ui.set", json!({"brushSize": 0.15, "brushFeather": 0.0, "brushFlow": 100.0}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
brush_at(&mut h, 0.5, 0.5);
|
||||
@@ -138,11 +140,14 @@ fn mask_adjustments_hide_overlay_without_disabling_the_mask() {
|
||||
use lightcraft_pipeline::Overlay;
|
||||
let mut h = detail("panel.masking");
|
||||
exec(&mut h, "mask.add", json!({"kind": "linear", "start": [0.5, 0.2], "end": [0.5, 0.7]}));
|
||||
assert!(h.app.ui.mask_overlay);
|
||||
let shown = |h: &Headless| matches!(crate::panels::detail::view_overlay(&h.app, &develop(h)), Overlay::Mask { .. });
|
||||
// a mask without settings shows what it selects, by itself (O is off)
|
||||
assert!(!h.app.ui.mask_overlay);
|
||||
assert!(shown(&h), "a new mask shows its overlay");
|
||||
|
||||
// Changing the shape needs the overlay; changing the image needs an unobscured preview.
|
||||
exec(&mut h, "mask.refine", json!({"value": 10.0}));
|
||||
assert!(h.app.ui.mask_overlay);
|
||||
assert!(shown(&h), "Refine Edges is the mask's shape, not a setting");
|
||||
// The dock header pushes this adjustment below the initial viewport. Exercise the
|
||||
// actual visible slider rather than sending a synthetic click outside its clipped body.
|
||||
let panel = h.app.widgets.iter().find(|(id, _)| id == "panel:right_panel").unwrap().1;
|
||||
@@ -155,21 +160,28 @@ fn mask_adjustments_hide_overlay_without_disabling_the_mask() {
|
||||
assert!(panel.contains_rect(slider), "exposure is visible before clicking: {slider:?} in {panel:?}");
|
||||
let r = h.request("ui.clickWidget", json!({"id": "slider:exposure", "fx": 0.7}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
assert!(!h.app.ui.mask_overlay, "the exposure slider hides the overlay after release");
|
||||
let d = develop(&h);
|
||||
assert!(d.masks[0].adjust.exposure > 0.0);
|
||||
assert!(d.masks[0].visible, "hiding the overlay must not disable the mask");
|
||||
assert_eq!(crate::panels::detail::view_overlay(&h.app, &d), Overlay::None);
|
||||
// the pointer is off the row and the pin: a mask with settings shows its effect, not the overlay
|
||||
h.app.ui.mask_hover = None;
|
||||
h.app.ui.mask_hover_prev = None;
|
||||
assert_eq!(crate::panels::detail::view_overlay(&h.app, &d), Overlay::None, "a mask with settings never shows by itself");
|
||||
let mask = d.masks[0].clone();
|
||||
|
||||
let r = h.request("ui.key", json!({"key": "o"}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
assert!(h.app.ui.mask_overlay, "O can restore the overlay");
|
||||
assert!(h.app.ui.mask_overlay, "O shows the overlay on request");
|
||||
assert_eq!(develop(&h).masks[0], mask, "toggling the overlay leaves the mask and its effect unchanged");
|
||||
assert!(matches!(crate::panels::detail::view_overlay(&h.app, &develop(&h)), Overlay::Mask { .. }));
|
||||
assert!(shown(&h));
|
||||
// a slider at work hides even an overlay switched on with O; it comes back when let go
|
||||
h.app.ui.dragging_control = Some("exposure".into());
|
||||
assert_eq!(crate::panels::detail::view_overlay(&h.app, &develop(&h)), Overlay::None, "nothing shows while a slider is at work");
|
||||
h.app.ui.dragging_control = None;
|
||||
assert!(shown(&h));
|
||||
|
||||
// Ctrl+Shift+O / Cmd+Shift+O shows every visible mask's region at once (the new command), ahead of the selected
|
||||
// mask overlay so it is not shadowed by the always-on single-mask overlay.
|
||||
// mask overlay so it is not shadowed by the single-mask overlay.
|
||||
exec(&mut h, "view.maskOverlayAll", json!({}));
|
||||
assert!(h.app.ui.mask_overlay_all, "the all-masks overlay command turns it on");
|
||||
assert!(matches!(crate::panels::detail::view_overlay(&h.app, &develop(&h)), Overlay::AllMasks { .. }));
|
||||
@@ -177,49 +189,190 @@ fn mask_adjustments_hide_overlay_without_disabling_the_mask() {
|
||||
assert!(!h.app.ui.mask_overlay_all, "the all-masks overlay command toggles it off");
|
||||
assert!(!matches!(crate::panels::detail::view_overlay(&h.app, &develop(&h)), Overlay::AllMasks { .. }));
|
||||
|
||||
// Failed edits and global adjustments must not hide the mask overlay.
|
||||
// O stays on through edits: failed ones, global adjustments and the mask's own values
|
||||
assert!(h.app.run("mask.adjust", json!({"id": 999, "values": {"exposure": 1.0}})).is_err());
|
||||
assert!(h.app.ui.mask_overlay);
|
||||
exec(&mut h, "develop.set", json!({"control": "light.exposure", "value": 0.5}));
|
||||
assert!(h.app.ui.mask_overlay);
|
||||
|
||||
// Numeric edits/resets and Amount use the same command path as the sliders.
|
||||
for values in [json!({"exposure": 0.0}), json!({"saturation": 20.0}), json!({"amount": 50.0})] {
|
||||
exec(&mut h, "view.maskOverlay", json!({"show": true}));
|
||||
exec(&mut h, "mask.adjust", json!({"values": values}));
|
||||
assert!(!h.app.ui.mask_overlay);
|
||||
assert!(h.app.ui.mask_overlay && shown(&h), "{values}");
|
||||
}
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
|
||||
/// A slider hides the overlay (above); a new mask, an added part, a duplicate or picking a mask in
|
||||
/// the list shows it again, so the Overlay menu's mode is what the photo shows (issue #1800).
|
||||
/// One overlay rule replaces showing the overlay again on every new, picked, duplicated or extended
|
||||
/// mask (issue #1800): a mask without settings shows what it selects by itself; picking a mask that
|
||||
/// has settings, adding a part to it or duplicating it shows its effect, so it can be judged; the
|
||||
/// pointer on one of its component rows (or its pin), or O, shows its overlay on request.
|
||||
#[test]
|
||||
fn a_new_or_picked_mask_shows_the_overlay_hidden_by_a_slider() {
|
||||
fn a_mask_shows_its_overlay_by_itself_only_without_settings() {
|
||||
use lightcraft_pipeline::Overlay;
|
||||
let mut h = detail("panel.masking");
|
||||
exec(&mut h, "mask.add", json!({"kind": "linear", "start": [0.5, 0.2], "end": [0.5, 0.7]}));
|
||||
let first = h.app.session.active_mask.unwrap();
|
||||
let hide = |h: &mut Headless| {
|
||||
exec(h, "mask.adjust", json!({"values": {"exposure": 0.5}}));
|
||||
assert!(!h.app.ui.mask_overlay);
|
||||
let off_rows = |h: &mut Headless| {
|
||||
h.app.ui.mask_hover = None;
|
||||
h.app.ui.mask_hover_prev = None;
|
||||
};
|
||||
let shown = |h: &Headless| matches!(crate::panels::detail::view_overlay(&h.app, &develop(h)), Overlay::Mask { .. });
|
||||
hide(&mut h);
|
||||
assert!(shown(&h), "a new mask without settings shows its overlay");
|
||||
exec(&mut h, "mask.adjust", json!({"values": {"exposure": 0.5}}));
|
||||
off_rows(&mut h);
|
||||
assert!(!shown(&h), "with settings it shows its effect");
|
||||
exec(&mut h, "mask.add", json!({"kind": "radial", "center": [0.4, 0.5], "rx": 0.2, "ry": 0.2}));
|
||||
off_rows(&mut h);
|
||||
assert!(shown(&h), "a new mask shows its overlay");
|
||||
hide(&mut h);
|
||||
let r = h.request("ui.clickWidget", json!({"id": format!("mask:{first}")}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
assert_eq!(h.app.session.active_mask, Some(first));
|
||||
assert!(shown(&h), "picking a mask in the list shows its overlay");
|
||||
off_rows(&mut h);
|
||||
assert!(!shown(&h), "picking a mask with settings shows its effect, not the overlay");
|
||||
for (cmd, params) in
|
||||
[("mask.addComponent", json!({"kind": "radial", "op": "add", "center": [0.6, 0.5], "rx": 0.1, "ry": 0.1})), ("mask.duplicate", json!({}))]
|
||||
{
|
||||
hide(&mut h);
|
||||
exec(&mut h, cmd, params);
|
||||
assert!(shown(&h), "{cmd} shows the overlay");
|
||||
off_rows(&mut h);
|
||||
assert!(!shown(&h), "{cmd} on a mask with settings shows its effect");
|
||||
}
|
||||
// on request: the pointer on one of its component rows (or its pin), or O
|
||||
h.app.ui.mask_hover = h.app.session.active().zip(h.app.session.active_mask);
|
||||
assert!(shown(&h), "the pointer on a component row shows the overlay");
|
||||
off_rows(&mut h);
|
||||
h.request("ui.key", json!({"key": "o"}), T);
|
||||
assert!(shown(&h), "O shows it");
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
|
||||
/// O hides a mask's automatic overlay until O shows it again: hiding another mask's doesn't bring
|
||||
/// the first one's back.
|
||||
#[test]
|
||||
fn each_mask_hidden_with_o_stays_hidden() {
|
||||
use lightcraft_pipeline::Overlay;
|
||||
let mut h = detail("panel.masking");
|
||||
let shown = |h: &Headless| matches!(crate::panels::detail::view_overlay(&h.app, &develop(h)), Overlay::Mask { .. });
|
||||
exec(&mut h, "mask.add", json!({"kind": "linear", "start": [0.5, 0.2], "end": [0.5, 0.7]}));
|
||||
let a = h.app.session.active_mask.unwrap();
|
||||
h.request("ui.key", json!({"key": "o"}), T);
|
||||
assert!(!shown(&h), "A hidden");
|
||||
exec(&mut h, "mask.add", json!({"kind": "radial", "center": [0.4, 0.5], "rx": 0.2, "ry": 0.2}));
|
||||
h.app.ui.mask_hover = None;
|
||||
h.app.ui.mask_hover_prev = None;
|
||||
assert!(shown(&h), "B, new, shows");
|
||||
h.request("ui.key", json!({"key": "o"}), T);
|
||||
assert!(!shown(&h), "B hidden");
|
||||
exec(&mut h, "mask.select", json!({"id": a}));
|
||||
h.app.ui.mask_hover = None;
|
||||
h.app.ui.mask_hover_prev = None;
|
||||
assert!(!shown(&h), "A is still hidden");
|
||||
h.request("ui.key", json!({"key": "o"}), T);
|
||||
assert!(shown(&h), "O shows A again");
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
|
||||
/// Which hover shows a mask's overlay (the user's test notes, 31 Oct): the mask's own row (name, eye, menu)
|
||||
/// shows none, so its eye can judge the effect with nothing over the photo; a component row under it shows the
|
||||
/// whole mask's overlay; the pin shows it; a mask without settings keeps its overlay, also over its own row; O still
|
||||
/// shows and hides it; dragging the pin hides it while it moves.
|
||||
#[test]
|
||||
fn the_mask_row_shows_no_overlay_and_a_component_row_does() {
|
||||
use lightcraft_pipeline::Overlay;
|
||||
let mut h = detail("panel.masking");
|
||||
let steps = |h: &mut Headless| {
|
||||
h.step();
|
||||
h.step();
|
||||
};
|
||||
let ask = |h: &mut Headless, method: &str, params: serde_json::Value| {
|
||||
let r = h.request(method, params.clone(), T);
|
||||
assert_eq!(r["ok"], true, "{method} {params}: {r}");
|
||||
};
|
||||
let shown = |h: &Headless| matches!(crate::panels::detail::view_overlay(&h.app, &develop(h)), Overlay::Mask { .. });
|
||||
let visible = |h: &Headless, id: u32| develop(h).masks.iter().find(|m| m.id == id).is_some_and(|m| m.visible);
|
||||
let canvas = h.app.canvas_rect.expect("the loupe");
|
||||
let away = json!({"x": canvas.left() + 6.0, "y": canvas.top() + 6.0});
|
||||
// a mask without settings: its overlay stays, whatever is hovered
|
||||
exec(&mut h, "mask.add", json!({"kind": "radial", "center": [0.5, 0.5]}));
|
||||
let mid = h.app.session.active_mask.expect("selected");
|
||||
steps(&mut h);
|
||||
ask(&mut h, "ui.hoverWidget", json!({"id": format!("mask:{mid}")}));
|
||||
steps(&mut h);
|
||||
assert!(shown(&h), "no settings yet: shown, also over its own row");
|
||||
// with settings: its own row and its eye show nothing; the eye switches the effect
|
||||
exec(&mut h, "mask.adjust", json!({"values": {"exposure": 1.0}}));
|
||||
ask(&mut h, "ui.hoverWidget", json!({"id": format!("mask:{mid}")}));
|
||||
steps(&mut h);
|
||||
assert!(!shown(&h), "the pointer on the mask's own row shows no overlay");
|
||||
ask(&mut h, "ui.clickWidget", json!({"id": format!("maskVisible:{mid}")}));
|
||||
steps(&mut h);
|
||||
assert!(!visible(&h, mid), "the eye switched the effect off");
|
||||
assert!(!shown(&h), "with nothing over the photo");
|
||||
ask(&mut h, "ui.clickWidget", json!({"id": format!("maskVisible:{mid}")}));
|
||||
steps(&mut h);
|
||||
assert!(visible(&h, mid) && !shown(&h), "and on again, still with no overlay");
|
||||
// a component row: the whole mask's overlay
|
||||
exec(&mut h, "mask.addComponent", json!({"op": "subtract", "kind": "linear", "start": [0.5, 0.0], "end": [0.5, 0.3]}));
|
||||
steps(&mut h);
|
||||
for i in 0..2 {
|
||||
ask(&mut h, "ui.hoverWidget", json!({"id": format!("component:{i}")}));
|
||||
steps(&mut h);
|
||||
assert!(shown(&h), "the pointer on component {i} shows the mask's overlay");
|
||||
assert_eq!(h.app.ui.mask_hover.or(h.app.ui.mask_hover_prev).map(|(_, m)| m), Some(mid), "the whole mask");
|
||||
}
|
||||
ask(&mut h, "ui.move", away.clone());
|
||||
steps(&mut h);
|
||||
assert!(!shown(&h), "leaving the row hides it");
|
||||
// the pin
|
||||
let img = h.app.image_rect.expect("the photo on screen");
|
||||
ask(&mut h, "ui.move", json!({"x": img.center().x, "y": img.center().y}));
|
||||
steps(&mut h);
|
||||
assert!(shown(&h), "the pointer on the pin shows the overlay");
|
||||
// dragging the pin: hidden while it moves
|
||||
pointer(&mut h, json!([{"kind": "down", "x": 0.5, "y": 0.5}, {"kind": "drag", "x": 0.53, "y": 0.52}, {"kind": "drag", "x": 0.56, "y": 0.54}]));
|
||||
steps(&mut h);
|
||||
assert!(crate::panels::detail::mask_gesture(&h.app), "the pin is being dragged: {:?}", h.app.gesture);
|
||||
assert!(!shown(&h), "no overlay while the pin is dragged");
|
||||
pointer(&mut h, json!([{"kind": "up", "x": 0.56, "y": 0.54}]));
|
||||
steps(&mut h);
|
||||
ask(&mut h, "ui.move", away);
|
||||
steps(&mut h);
|
||||
assert!(!shown(&h));
|
||||
// O over its own row
|
||||
ask(&mut h, "ui.hoverWidget", json!({"id": format!("mask:{mid}")}));
|
||||
exec(&mut h, "view.maskOverlay", json!({"show": true}));
|
||||
steps(&mut h);
|
||||
assert!(shown(&h), "O shows it, even over its own row");
|
||||
exec(&mut h, "view.maskOverlay", json!({"show": false}));
|
||||
steps(&mut h);
|
||||
assert!(!shown(&h), "and hides it");
|
||||
}
|
||||
|
||||
/// The pointer on a mask's row, and O hiding a mask's automatic overlay, belong to that photo: on
|
||||
/// another photo a mask with the same id is another mask.
|
||||
#[test]
|
||||
fn a_mask_hovered_or_hidden_on_one_photo_says_nothing_about_another() {
|
||||
use lightcraft_pipeline::Overlay;
|
||||
let mut h = detail("panel.masking");
|
||||
let first = h.app.session.active().unwrap();
|
||||
exec(&mut h, "mask.add", json!({"kind": "linear", "start": [0.5, 0.2], "end": [0.5, 0.7]}));
|
||||
let mask = h.app.session.active_mask.unwrap();
|
||||
let shown = |h: &Headless| matches!(crate::panels::detail::view_overlay(&h.app, &develop(h)), Overlay::Mask { .. });
|
||||
// O hides the fresh mask's overlay on this photo
|
||||
h.request("ui.key", json!({"key": "o"}), T);
|
||||
assert!(!shown(&h));
|
||||
assert_eq!(h.app.ui.mask_overlay_hidden, vec![(first, mask)]);
|
||||
// another photo with a fresh mask of the same id still shows it
|
||||
let other = h.app.session.visible_cloned().into_iter().find(|p| *p != first).unwrap();
|
||||
exec(&mut h, "library.select", json!({"ids": [other.0]}));
|
||||
exec(&mut h, "mask.add", json!({"kind": "linear", "start": [0.5, 0.2], "end": [0.5, 0.7]}));
|
||||
assert_eq!(h.app.session.active(), Some(other));
|
||||
assert_eq!(h.app.session.active_mask, Some(mask), "the same id on the other photo");
|
||||
h.app.ui.mask_hover = None;
|
||||
h.app.ui.mask_hover_prev = None;
|
||||
assert!(shown(&h), "hidden on the first photo only");
|
||||
// a hover left over from the first photo doesn't count here
|
||||
exec(&mut h, "mask.adjust", json!({"values": {"exposure": 0.5}}));
|
||||
h.app.ui.mask_hover_prev = Some((first, mask));
|
||||
assert!(!shown(&h), "the first photo's hover is not this photo's");
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
|
||||
@@ -2156,6 +2309,320 @@ fn effect_dropdown_applies_saves_and_shows_the_matching_effect() {
|
||||
assert_eq!(exec(&mut h, "mask.effects", json!({}))["current"], "Lift");
|
||||
}
|
||||
|
||||
/// A mask O hid stays hidden after O shows another mask: selecting it again doesn't bring it back.
|
||||
#[test]
|
||||
fn a_mask_hidden_with_o_stays_hidden_after_o_shows_another() {
|
||||
use lightcraft_pipeline::Overlay;
|
||||
let mut h = detail("panel.masking");
|
||||
let shown = |h: &Headless| matches!(crate::panels::detail::view_overlay(&h.app, &develop(h)), Overlay::Mask { .. });
|
||||
exec(&mut h, "mask.add", json!({"kind": "linear", "start": [0.5, 0.2], "end": [0.5, 0.7]}));
|
||||
let a = h.app.session.active_mask.unwrap();
|
||||
h.request("ui.key", json!({"key": "o"}), T);
|
||||
assert!(!shown(&h), "A hidden");
|
||||
exec(&mut h, "mask.add", json!({"kind": "radial", "center": [0.4, 0.5], "rx": 0.2, "ry": 0.2}));
|
||||
exec(&mut h, "mask.adjust", json!({"values": {"exposure": 0.5}}));
|
||||
h.app.ui.mask_hover = None;
|
||||
h.app.ui.mask_hover_prev = None;
|
||||
assert!(!shown(&h), "B has settings: its effect shows");
|
||||
h.request("ui.key", json!({"key": "o"}), T);
|
||||
assert!(shown(&h), "O shows B's overlay");
|
||||
exec(&mut h, "mask.select", json!({"id": a}));
|
||||
h.app.ui.mask_hover = None;
|
||||
h.app.ui.mask_hover_prev = None;
|
||||
assert!(!shown(&h), "A is still hidden");
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
|
||||
/// The all-masks overlay waits while an AI selection is computed: its stand-in would look like the
|
||||
/// result.
|
||||
#[test]
|
||||
fn the_all_masks_overlay_waits_for_an_ai_selection() {
|
||||
use lightcraft_develop::{Mask, MaskComponent, MaskOp, MaskShape};
|
||||
use lightcraft_geom::Point;
|
||||
let component = |shape| MaskComponent { name: None, op: MaskOp::Add, invert: false, shape };
|
||||
let linear = component(MaskShape::Linear { start: Point::new(0.5, 0.2), end: Point::new(0.5, 0.7) });
|
||||
let mut d = lightcraft_develop::DevelopSettings::default();
|
||||
d.masks.push(Mask { id: 1, components: vec![linear], visible: true, ..Default::default() });
|
||||
assert!(crate::panels::detail::all_masks_showable(&d, true));
|
||||
let object = component(MaskShape::Object { hint: vec![Point::new(0.5, 0.5)], exclude: Vec::new(), seg: None, detail: Vec::new(), edge: 0.0 });
|
||||
d.masks.push(Mask { id: 2, components: vec![object], visible: true, ..Default::default() });
|
||||
assert!(!crate::panels::detail::all_masks_showable(&d, true), "an Object selection is being computed");
|
||||
assert!(crate::panels::detail::all_masks_showable(&d, false), "nothing is computing");
|
||||
}
|
||||
|
||||
/// A deleted mask's id goes to the next new mask: O having hid the deleted one's overlay says nothing about the
|
||||
/// new one (CodeRabbit on #2920).
|
||||
#[test]
|
||||
fn a_new_mask_with_a_deleted_masks_id_shows_its_overlay() {
|
||||
use lightcraft_pipeline::Overlay;
|
||||
let mut h = detail("panel.masking");
|
||||
exec(&mut h, "mask.add", json!({"kind": "linear", "start": [0.5, 0.2], "end": [0.5, 0.7]}));
|
||||
let mask = h.app.session.active_mask.unwrap();
|
||||
let shown = |h: &Headless| matches!(crate::panels::detail::view_overlay(&h.app, &develop(h)), Overlay::Mask { .. });
|
||||
h.request("ui.key", json!({"key": "o"}), T);
|
||||
assert!(!shown(&h));
|
||||
crate::panels::masking::delete_mask(&mut h.app, None);
|
||||
assert!(h.app.ui.mask_overlay_hidden.is_empty(), "forgotten with the mask");
|
||||
exec(&mut h, "mask.add", json!({"kind": "radial", "center": [0.4, 0.5], "rx": 0.2, "ry": 0.2}));
|
||||
assert_eq!(h.app.session.active_mask, Some(mask), "the same id again");
|
||||
h.app.ui.mask_hover = None;
|
||||
h.app.ui.mask_hover_prev = None;
|
||||
assert!(shown(&h), "the new mask shows");
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
|
||||
/// Undo taking a new mask away frees its id the same way: O having hid its overlay says nothing about the next
|
||||
/// new mask (CodeRabbit on #2920).
|
||||
#[test]
|
||||
fn a_new_mask_after_undoing_a_hidden_one_shows_its_overlay() {
|
||||
use lightcraft_pipeline::Overlay;
|
||||
let mut h = detail("panel.masking");
|
||||
exec(&mut h, "mask.add", json!({"kind": "linear", "start": [0.5, 0.2], "end": [0.5, 0.7]}));
|
||||
let mask = h.app.session.active_mask.unwrap();
|
||||
let shown = |h: &Headless| matches!(crate::panels::detail::view_overlay(&h.app, &develop(h)), Overlay::Mask { .. });
|
||||
h.request("ui.key", json!({"key": "o"}), T);
|
||||
assert!(!shown(&h));
|
||||
exec(&mut h, "edit.undo", json!({}));
|
||||
assert!(develop(&h).masks.iter().all(|m| m.id != mask), "the mask is undone");
|
||||
assert!(h.app.ui.mask_overlay_hidden.is_empty(), "forgotten with the mask");
|
||||
exec(&mut h, "mask.add", json!({"kind": "radial", "center": [0.4, 0.5], "rx": 0.2, "ry": 0.2}));
|
||||
assert_eq!(h.app.session.active_mask, Some(mask), "the same id again");
|
||||
h.app.ui.mask_hover = None;
|
||||
h.app.ui.mask_hover_prev = None;
|
||||
assert!(shown(&h), "the new mask shows");
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
|
||||
/// Painting on a mask that has settings shows its effect as it is painted (the stroke goes to the
|
||||
/// photo live, one undo step), never the red stroke; a mask without settings, or O, still shows the
|
||||
/// red stroke while painting (found in an evening of real editing).
|
||||
#[test]
|
||||
fn painting_a_mask_with_settings_shows_its_effect_not_red() {
|
||||
let mut h = detail("panel.masking");
|
||||
h.settle(SETTLE);
|
||||
exec(&mut h, "tool.brush", json!({"new": true}));
|
||||
h.app.ui.brush_auto_mask = false;
|
||||
let strokes = |h: &Headless, mid: u32| -> Vec<usize> {
|
||||
develop(h)
|
||||
.masks
|
||||
.iter()
|
||||
.find(|m| m.id == mid)
|
||||
.map(|m| {
|
||||
m.components.iter().filter_map(|c| if let MaskShape::Brush { strokes } = &c.shape { Some(strokes.len()) } else { None }).collect()
|
||||
})
|
||||
.unwrap_or_default()
|
||||
};
|
||||
// no settings: the red stroke while painting
|
||||
pointer(&mut h, json!([{"kind": "down", "x": 0.2, "y": 0.5}, {"kind": "drag", "x": 0.25, "y": 0.5}, {"kind": "drag", "x": 0.3, "y": 0.5}]));
|
||||
assert!(h.app.brush_live.is_some(), "a mask without settings shows the red stroke");
|
||||
pointer(&mut h, json!([{"kind": "up", "x": 0.3, "y": 0.5}]));
|
||||
let mid = h.app.session.active_mask.expect("the brush mask");
|
||||
assert_eq!(strokes(&h, mid), vec![1]);
|
||||
// with settings: no red; the stroke is on the photo while painted, one undo step
|
||||
exec(&mut h, "mask.adjust", json!({"values": {"exposure": 1.0}}));
|
||||
assert_eq!(h.app.ui.tool, "brush", "the brush stays armed on its mask");
|
||||
pointer(&mut h, json!([{"kind": "down", "x": 0.2, "y": 0.7}, {"kind": "drag", "x": 0.25, "y": 0.7}, {"kind": "drag", "x": 0.3, "y": 0.7}]));
|
||||
assert!(h.app.brush_live.is_none(), "no red stroke on a mask with settings");
|
||||
assert_eq!(strokes(&h, mid), vec![2], "the stroke shows its effect on the photo while painted");
|
||||
assert!(h.app.session.interaction.is_some(), "one undo step stays open while painting");
|
||||
pointer(&mut h, json!([{"kind": "up", "x": 0.3, "y": 0.7}]));
|
||||
h.step();
|
||||
assert_eq!(strokes(&h, mid), vec![2]);
|
||||
assert!(h.app.session.interaction.is_none());
|
||||
exec(&mut h, "edit.undo", json!({}));
|
||||
assert_eq!(strokes(&h, mid), vec![1], "one undo removes the whole stroke");
|
||||
// O shows the overlay on purpose: the red stroke again
|
||||
exec(&mut h, "view.maskOverlay", json!({"show": true}));
|
||||
pointer(&mut h, json!([{"kind": "down", "x": 0.2, "y": 0.3}, {"kind": "drag", "x": 0.25, "y": 0.3}, {"kind": "drag", "x": 0.3, "y": 0.3}]));
|
||||
assert!(h.app.brush_live.is_some(), "O: the overlay colour while painting");
|
||||
pointer(&mut h, json!([{"kind": "up", "x": 0.3, "y": 0.3}]));
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
|
||||
/// A live stroke the photo refused (here: more pressure values than points) is not live: the release
|
||||
/// adds it as a new stroke instead of replacing the mask's previous one (CodeRabbit on #2920).
|
||||
#[test]
|
||||
fn a_refused_live_stroke_does_not_replace_the_previous_stroke() {
|
||||
let mut h = detail("panel.masking");
|
||||
h.settle(SETTLE);
|
||||
exec(&mut h, "tool.brush", json!({"new": true}));
|
||||
h.app.ui.brush_auto_mask = false;
|
||||
brush_at(&mut h, 0.2, 0.5);
|
||||
exec(&mut h, "mask.adjust", json!({"values": {"exposure": 1.0}}));
|
||||
let before = develop(&h).masks.last().map(|m| m.components.clone());
|
||||
let p = |x: f64| lightcraft_geom::Point::new(x, 0.7);
|
||||
h.app.gesture = Some(crate::panels::detail::Gesture::Brush { points: vec![p(0.2), p(0.3)], pressure: vec![1.0; 3], live: None });
|
||||
h.step();
|
||||
assert!(matches!(h.app.gesture, Some(crate::panels::detail::Gesture::Brush { live: None, .. })), "a refused stroke must not count as live");
|
||||
assert!(h.app.session.interaction.is_none(), "the refused stroke's undo step is closed");
|
||||
assert_eq!(develop(&h).masks.last().map(|m| m.components.clone()), before, "the previous stroke is untouched");
|
||||
h.app.gesture = None;
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
|
||||
/// Another tool chosen while a live Brush stroke is open (a gradient's key mid-stroke) ends the stroke first: the
|
||||
/// new mask is a step of its own, not folded into the "Brush" step (CodeRabbit on #2920).
|
||||
#[test]
|
||||
fn a_gradient_chosen_mid_stroke_is_its_own_undo_step() {
|
||||
let mut h = detail("panel.masking");
|
||||
h.settle(SETTLE);
|
||||
exec(&mut h, "tool.brush", json!({"new": true}));
|
||||
h.app.ui.brush_auto_mask = false;
|
||||
brush_at(&mut h, 0.2, 0.5);
|
||||
exec(&mut h, "mask.adjust", json!({"values": {"exposure": 1.0}}));
|
||||
pointer(&mut h, json!([{"kind": "down", "x": 0.2, "y": 0.7}, {"kind": "drag", "x": 0.25, "y": 0.7}, {"kind": "drag", "x": 0.3, "y": 0.7}]));
|
||||
assert!(matches!(h.app.gesture, Some(crate::panels::detail::Gesture::Brush { live: Some(_), .. })), "a live stroke");
|
||||
let masks = develop(&h).masks.len();
|
||||
exec(&mut h, "tool.linear", json!({}));
|
||||
assert!(h.app.gesture.is_none(), "the stroke ended");
|
||||
assert!(h.app.session.interaction.is_none(), "its undo step closed");
|
||||
assert_eq!(develop(&h).masks.len(), masks + 1);
|
||||
exec(&mut h, "edit.undo", json!({}));
|
||||
assert_eq!(develop(&h).masks.len(), masks, "one undo takes the gradient alone");
|
||||
pointer(&mut h, json!([{"kind": "up", "x": 0.3, "y": 0.7}]));
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
|
||||
/// A stroke that never went live (its mask has no settings) still ends when another tool is chosen
|
||||
/// mid-stroke: back on the brush, the next stroke starts afresh instead of carrying on from it
|
||||
/// (CodeRabbit on #2920).
|
||||
#[test]
|
||||
fn a_tool_chosen_mid_stroke_drops_a_stroke_that_was_not_live() {
|
||||
let mut h = detail("panel.masking");
|
||||
h.settle(SETTLE);
|
||||
exec(&mut h, "tool.brush", json!({"new": true}));
|
||||
h.app.ui.brush_auto_mask = false;
|
||||
pointer(&mut h, json!([{"kind": "down", "x": 0.2, "y": 0.5}, {"kind": "drag", "x": 0.25, "y": 0.5}, {"kind": "drag", "x": 0.3, "y": 0.5}]));
|
||||
assert!(matches!(h.app.gesture, Some(crate::panels::detail::Gesture::Brush { live: None, .. })), "a stroke, not live");
|
||||
exec(&mut h, "tool.linear", json!({}));
|
||||
assert!(h.app.gesture.is_none(), "the stroke is dropped");
|
||||
assert!(h.app.brush_live.is_none());
|
||||
pointer(&mut h, json!([{"kind": "up", "x": 0.3, "y": 0.5}]));
|
||||
exec(&mut h, "tool.brush", json!({}));
|
||||
pointer(&mut h, json!([{"kind": "down", "x": 0.6, "y": 0.4}, {"kind": "drag", "x": 0.65, "y": 0.4}]));
|
||||
let first = match &h.app.gesture {
|
||||
Some(crate::panels::detail::Gesture::Brush { points, .. }) => points.first().map(|p| p.x),
|
||||
_ => None,
|
||||
};
|
||||
assert!(first.is_some_and(|x| x > 0.5), "the next stroke starts where it was painted: {first:?}");
|
||||
pointer(&mut h, json!([{"kind": "up", "x": 0.65, "y": 0.4}]));
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
|
||||
/// The overlay falls back to the last frame's hovered mask while this frame's panels set the new one, so a frame in
|
||||
/// which the hovered row or pin changed (or the pointer left them) asks for one more: the overlay follows the
|
||||
/// pointer at once, not at the next input (CodeRabbit on #2920).
|
||||
#[test]
|
||||
fn a_frame_whose_hovered_mask_changed_asks_for_another() {
|
||||
let mut h = detail("panel.masking");
|
||||
let row = Some((lightcraft_catalog::PhotoId(1), 1));
|
||||
let asks = |h: &mut Headless, now, before| {
|
||||
h.app.ui.mask_hover = now;
|
||||
h.app.ui.mask_hover_prev = before;
|
||||
// (a settled context: its own first frames asked for, so only this frame's request counts)
|
||||
let ctx = egui::Context::default();
|
||||
for _ in 0..3 {
|
||||
ctx.run_ui(egui::RawInput::default(), |_| {}).textures_delta.clear();
|
||||
}
|
||||
let asked = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false));
|
||||
let seen = asked.clone();
|
||||
ctx.set_request_repaint_callback(move |_| seen.store(true, std::sync::atomic::Ordering::Relaxed));
|
||||
h.app.repaint_on_mask_hover_change(&ctx);
|
||||
asked.load(std::sync::atomic::Ordering::Relaxed)
|
||||
};
|
||||
assert!(asks(&mut h, row, None), "onto a row");
|
||||
assert!(asks(&mut h, None, row), "off it");
|
||||
assert!(asks(&mut h, Some((lightcraft_catalog::PhotoId(1), 2)), row), "onto another");
|
||||
assert!(!asks(&mut h, row, row), "resting on the same row");
|
||||
assert!(!asks(&mut h, None, None), "nowhere near");
|
||||
}
|
||||
|
||||
/// Picking another mask or another photo (also with the arrow keys), Undo, or a Brush request that makes a new mask
|
||||
/// while a live Brush stroke is held ends the stroke first: its next live update or its release can't replace the
|
||||
/// picked mask's strokes, the stroke before the undone one, or start a mask on the new photo, and the pointer
|
||||
/// still held paints nothing more until it is let go (CodeRabbit on #2920).
|
||||
#[test]
|
||||
fn picking_another_mask_or_photo_mid_stroke_ends_the_stroke() {
|
||||
let stroke_count = |h: &Headless, id: u32| -> usize {
|
||||
develop(h)
|
||||
.masks
|
||||
.iter()
|
||||
.find(|m| m.id == id)
|
||||
.map(|m| m.components.iter().map(|c| if let MaskShape::Brush { strokes } = &c.shape { strokes.len() } else { 0 }).sum())
|
||||
.unwrap_or(0)
|
||||
};
|
||||
for pick in ["mask", "photo", "next", "undo", "new"] {
|
||||
let mut h = detail("panel.masking");
|
||||
h.settle(SETTLE);
|
||||
exec(&mut h, "tool.brush", json!({"new": true}));
|
||||
h.app.ui.brush_auto_mask = false;
|
||||
brush_at(&mut h, 0.2, 0.5);
|
||||
exec(&mut h, "mask.adjust", json!({"values": {"exposure": 1.0}}));
|
||||
let first = h.app.session.active_mask.expect("the first mask");
|
||||
exec(&mut h, "tool.brush", json!({"new": true}));
|
||||
brush_at(&mut h, 0.6, 0.5);
|
||||
exec(&mut h, "mask.adjust", json!({"values": {"exposure": -1.0}}));
|
||||
let second = h.app.session.active_mask.expect("the second mask");
|
||||
assert_ne!(first, second);
|
||||
let second_before = develop(&h).masks.iter().find(|m| m.id == second).cloned();
|
||||
// a live stroke on the second mask (it has settings: its effect shows while painting)
|
||||
pointer(&mut h, json!([{"kind": "down", "x": 0.6, "y": 0.7}, {"kind": "drag", "x": 0.65, "y": 0.7}, {"kind": "drag", "x": 0.7, "y": 0.7}]));
|
||||
h.step();
|
||||
assert!(matches!(h.app.gesture, Some(crate::panels::detail::Gesture::Brush { live: Some(_), .. })), "{pick}: a live stroke");
|
||||
let photo = h.app.session.active().expect("a photo");
|
||||
let (first_strokes, masks) = (stroke_count(&h, first), develop(&h).masks.len());
|
||||
match pick {
|
||||
"mask" => {
|
||||
exec(&mut h, "mask.select", json!({"id": first}));
|
||||
}
|
||||
"photo" => {
|
||||
let other = h.app.session.visible_cloned().into_iter().find(|p| *p != photo).expect("another photo");
|
||||
exec(&mut h, "library.select", json!({"ids": [other.0]}));
|
||||
}
|
||||
"next" => {
|
||||
exec(&mut h, "library.next", json!({}));
|
||||
assert_ne!(h.app.session.active(), Some(photo), "stepped to the next photo");
|
||||
}
|
||||
"undo" => {
|
||||
exec(&mut h, "edit.undo", json!({}));
|
||||
}
|
||||
_ => {
|
||||
exec(&mut h, "tool.brush", json!({"new": true}));
|
||||
}
|
||||
}
|
||||
let (third, second_now) = (h.app.session.active_mask, stroke_count(&h, second));
|
||||
assert!(h.app.gesture.is_none(), "{pick}: the stroke ended");
|
||||
assert!(h.app.session.interaction.is_none(), "{pick}: its undo step closed");
|
||||
// the pointer carries on and lets go: nothing lands on what was picked
|
||||
pointer(&mut h, json!([{"kind": "drag", "x": 0.75, "y": 0.7}, {"kind": "drag", "x": 0.8, "y": 0.7}, {"kind": "up", "x": 0.8, "y": 0.7}]));
|
||||
h.step();
|
||||
h.step();
|
||||
match pick {
|
||||
"mask" => {
|
||||
assert_eq!(stroke_count(&h, first), first_strokes, "the picked mask's strokes are untouched");
|
||||
assert_eq!(develop(&h).masks.len(), masks, "no new mask");
|
||||
}
|
||||
"undo" => {
|
||||
let second_after = develop(&h).masks.iter().find(|m| m.id == second).cloned();
|
||||
assert_eq!(second_after, second_before, "the stroke before the undone one is kept as it was");
|
||||
}
|
||||
"new" => {
|
||||
assert_ne!(third, Some(second), "a new mask");
|
||||
assert_eq!(stroke_count(&h, second), second_now, "what was painted stays on its mask, nothing more");
|
||||
assert_eq!(third.map_or(0, |m| stroke_count(&h, m)), 0, "nothing of the old stroke lands on the new mask");
|
||||
}
|
||||
_ => assert!(develop(&h).masks.is_empty(), "{pick}: no mask started on the new photo: {:?}", develop(&h).masks.len()),
|
||||
}
|
||||
// and the next press paints again (the brush armed again: picking a mask or photo puts it down)
|
||||
exec(&mut h, "tool.brush", json!({}));
|
||||
h.step();
|
||||
pointer(&mut h, json!([{"kind": "down", "x": 0.3, "y": 0.3}, {"kind": "drag", "x": 0.35, "y": 0.3}, {"kind": "up", "x": 0.35, "y": 0.3}]));
|
||||
h.step();
|
||||
assert!(!develop(&h).masks.is_empty(), "{pick}: a new press paints");
|
||||
h.settle(SETTLE);
|
||||
}
|
||||
}
|
||||
|
||||
/// Lens Blur Brush Refinement: Focus / Blur pick a brush that paints on the photo from the Edit
|
||||
/// panel (one `lensBlur.brushStroke` per drag, with the brush's settings); ⌥ erases; Reset clears.
|
||||
#[test]
|
||||
|
||||
@@ -233,13 +233,16 @@ mod in_the_loupe {
|
||||
}
|
||||
h.request("engine.execute", json!({"command": "view.zoom100"}), T);
|
||||
h.app.ui.pan = (0.3, 0.4);
|
||||
// (a mask without settings shows its overlay by itself: O hides it for that mask)
|
||||
h.app.ui.mask_overlay = false;
|
||||
h.app.ui.mask_overlay_hidden = h.app.session.active().zip(h.app.session.active_mask).into_iter().collect();
|
||||
h.settle(SETTLE);
|
||||
let (zoom, pan) = (h.app.ui.zoom, h.app.ui.pan);
|
||||
assert_eq!(zoom, crate::state::Zoom::Percent(100.0));
|
||||
let plain = h.app.region_view.expect("a window render without the overlay");
|
||||
|
||||
h.app.ui.mask_overlay = true;
|
||||
h.app.ui.mask_overlay_hidden.clear();
|
||||
h.settle(SETTLE);
|
||||
let id = h.app.session.active().expect("a photo");
|
||||
let d = h.app.session.develop_of(id).expect("settings");
|
||||
@@ -253,6 +256,7 @@ mod in_the_loupe {
|
||||
assert_ne!(shown.settings, plain.settings, "the overlay is part of the window's look");
|
||||
|
||||
h.app.ui.mask_overlay = false;
|
||||
h.app.ui.mask_overlay_hidden = h.app.session.active().zip(h.app.session.active_mask).into_iter().collect();
|
||||
h.settle(SETTLE);
|
||||
assert_eq!((h.app.ui.zoom, h.app.ui.pan), (zoom, pan), "hiding it keeps them too");
|
||||
assert_eq!(h.app.region_view.map(|r| r.settings), Some(plain.settings), "back to the plain window");
|
||||
|
||||
@@ -87,6 +87,20 @@ fn switching_libraries_restarts_the_brief_info_overlay() {
|
||||
let _ = std::fs::remove_dir_all(dir);
|
||||
}
|
||||
|
||||
/// Masks hidden with O are keyed by photo and mask ID, both local to a library: a mask in the new
|
||||
/// library with the same IDs is not hidden by them.
|
||||
#[test]
|
||||
fn switching_libraries_forgets_the_masks_hidden_with_o() {
|
||||
let dir = temp("switch-hidden-masks");
|
||||
let mut app = app_in(&dir);
|
||||
app.ui.mask_overlay_hidden = vec![(lightcraft_catalog::PhotoId(1), 1)];
|
||||
app.ui.mask_hover = Some((lightcraft_catalog::PhotoId(1), 1));
|
||||
app.run("app.newLibrary", json!({"path": dir.to_string_lossy(), "name": "Second"})).unwrap();
|
||||
assert!(app.ui.mask_overlay_hidden.is_empty());
|
||||
assert_eq!(app.ui.mask_hover, None);
|
||||
let _ = std::fs::remove_dir_all(dir);
|
||||
}
|
||||
|
||||
fn recent_submenu(app: &LightcraftApp) -> Vec<crate::menubar::MenuNode> {
|
||||
use crate::menubar::MenuNode;
|
||||
let bar = crate::menubar::menu_bar(app);
|
||||
|
||||
@@ -315,7 +315,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts).
|
||||
| LR-MASK-FEATHER-EDGE | Refine mask edges | P2 | ✅ | `cmd:mask.refine`, `crates/pipeline/src/masks.rs` (`evaluate_one`) | Refine Edges slider per mask: guided filter on the photo's luminance snaps soft mask edges to the photo's edges (rendered on the CPU) |
|
||||
| LR-MASK-SLIDERS | Local adjustment sliders | P0 | ✅ | `cmd:mask.adjust`, `crates/pipeline/src/finish.rs`, `crates/pipeline/src/lens_blur.rs` | every slider renders (CPU + GPU), incl. Noise, Moiré, Defringe (negative Defringe has no effect); no local curve. Beyond Lightroom: a Lens Blur block in every mask (`crates/ui-egui/src/panels/masking.rs`, `lens_blur_block`): blur the selection or what it leaves out, Amount, Boost, Transition (the blur grows away from what stays sharp), an eye to switch it off; disc bokeh, no halo |
|
||||
| LR-MASK-EFFECTS | Local adjustment (effect / brush) presets | P1 | ✅ | `cmd:mask.effects`, `cmd:mask.applyEffect`, `cmd:mask.saveEffect`, `cmd:mask.updateEffect`, `cmd:mask.renameEffect`, `cmd:mask.duplicateEffect`, `cmd:mask.deleteEffect`, `cmd:mask.favoriteEffect`, `cmd:mask.setEffectGroup`, `cmd:mask.renameEffectGroup`, `cmd:mask.toolEffect`, `cmd:mask.importEffects`, `cmd:mask.exportEffects`, `cmd:dialog.saveMaskEffect`, `cmd:dialog.manageMaskEffects`, `cmd:file.exportMaskEffects`, `crates/engine/src/cmd/mask_effects.rs`, `crates/engine/src/cmd/mask_effect_files.rs`, `crates/ui-egui/src/panels/mask_effects.rs` | Effect menu above the mask sliders: grouped (folders, ★ Favorites first), searchable, scrolls, ↑ ↓ Return, ✓ on the matching effect (else Custom), resting on an effect previews it on the photo; right-click: apply to all masks / to the same-named mask on the selected photos (one undo step), update, rename, duplicate, star, move to group, delete (asks first); Reset Sliders; New Effect Preset dialog: which sliders (All / None / Changed Only), Amount, brush size/feather/flow; any mask type; Manage Effect Presets window (search, inline rename, update, duplicate, stars, groups, export, delete with confirmation); a new mask starts with the effect last applied to a mask of its kind (per tool, kept with the library); imports Lightroom Classic local `.lrtemplate` presets, Camera Raw local-correction `.xmp` presets, `.lceffect` and `.zip` bundles, through File ▸ Import Profiles & Presets… and drag & drop too; folders and LrC divider presets (`10 ----- DETAIL ----- 10`) become groups; settings with no local slider here (`grain`, Point Color `pointColors`, `toningLuminance`) are reported and kept with the effect for export, not applied (🟡 for those); brush size/feather/flow aren't in LrC presets (it keeps them per brush), so only `.lceffect` carries them; no built-in effects |
|
||||
| LR-MASK-OVERLAY | Mask overlay | P0 | ✅ | `cmd:view.maskOverlay`, `cmd:view.maskOverlayMode`, `cmd:view.maskOverlayColor`, `crates/pipeline/src/visualize.rs` | rendered alpha of the selected mask (CPU + GPU): colour, colour on B&W, image on black/white, white on black; ⇧O cycles while masking; successful local adjustments (including Amount) hide the overlay until O / the eye shows it again or a mask is created, picked, duplicated or added to (issue #1800); shape/edge edits retain it; zoomed in, the overlay is rendered on the same sharp window as the plain view (zoom and pan unchanged; `crates/ui-egui/src/tests/preview_limit.rs`, `crates/pipeline/src/tests_window.rs`); no auto-show on hover |
|
||||
| LR-MASK-OVERLAY | Mask overlay | P0 | ✅ | `cmd:view.maskOverlay`, `cmd:view.maskOverlayMode`, `cmd:view.maskOverlayColor`, `crates/pipeline/src/visualize.rs`, `crates/ui-egui/src/panels/detail.rs` (`overlay_mask`, `adjusting`) | one rule decides when the overlay shows: O / the eye by the Masks title (on to stay), or the pointer on one of a mask's component rows or its pin while nothing is being adjusted (the mask's own row shows none: its eye judges the effect with nothing over the photo), or by itself for a mask without settings yet; a mask with settings never shows by itself (picking, creating, duplicating or adding to it shows its effect, replacing #1800's re-show); nothing shows while a slider is at work, and it comes back when let go; during a mask drag or brush stroke hovering shows no overlay, while O and a mask without settings keep theirs; no stand-in overlay while an Object click or a description is still being computed; rendered alpha of the selected mask (CPU + GPU): colour, colour on B&W, image on black/white, white on black; ⇧O cycles while masking; zoomed in, the overlay is rendered on the same sharp window as the plain view (zoom and pan unchanged; `crates/ui-egui/src/tests/preview_limit.rs`, `crates/pipeline/src/tests_window.rs`) |
|
||||
| LR-MASK-OVERLAYALL | Show all mask overlays | P1 | ✅ | `cmd:view.maskOverlayAll`, `crates/ui-egui/src/panels/masking.rs`, `crates/pipeline/src/visualize.rs` | one diagnostic tint over every visible mask at once (CPU + GPU): the masks still stack their adjustments as before — this only paints each mask's region together, so you can see all masked areas at a glance (⌘⇧O / Ctrl+Shift+O) |
|
||||
| LR-MASK-PINS | Pins | P1 | ✅ | `cmd:view.maskPins`, `cmd:view.toolOverlay`, `crates/ui-egui/src/panels/detail.rs`, `crates/ui-egui/src/tests/tool_overlay.rs`, `crates/ui-egui/src/tests/masking.rs` | a pin per radial/linear/brush component: click selects its mask, drag moves it; Object (at its first click) and Describe (on what it found) components have pins too: click selects, drag changes nothing (issue #3049); Show Pins on follows the Tool Overlay mode (Auto: while the pointer is over the photo, hidden while brushing; Always; Selected: the selected mask's; Never; ⇧H cycles, #224); no pins for range components or Subject, Sky, Background, People and Landscape |
|
||||
| LR-MASK-UPDATE | Recompute AI masks | P2 | ⬜ | | |
|
||||
@@ -832,6 +832,8 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove
|
||||
| 2026-10-26 | minor | LR-BEHAV-PANEL-RESIZE, KEY-INFO: closing a tool panel (Crop, Remove, Masking, Red Eye) puts back the panel shown before it, hidden if it was hidden, at the same width and scroll position; a panel key or button (I, M, C, H…) pressed again puts back exactly what the right column showed before it (Edit → I → I = Edit, closed → I → I = closed); status unchanged (✅) |
|
||||
| 2026-10-25 | patch | LRC-LIB-KEYWORDS: a file whose keyword list is one `dc:subject` (or `lr:hierarchicalSubject`) entry with a keyword a line is read as one keyword a line; a library holding such a keyword is repaired when it opens (journaled, not an undo step); sidebar and Keyword List rows draw a name on one line; status unchanged |
|
||||
| 2026-10-25 | minor | LR-BEHAV-WINDOW (new row, 🟡): on Windows a window remembered maximized is built at its size and maximized once it shows (built maximized it could cover half the screen while Windows took it for maximized), and restored and maximized again once if it only says so; a window remembered larger than the screen it opens on is fitted to it, on every platform |
|
||||
| 2026-10-31 | patch | LR-MASK-OVERLAY: the pointer on a mask's own row (name, eye, menu) shows no overlay, so its eye judges the effect; a component row under it shows the whole mask's overlay; status unchanged (✅) |
|
||||
| 2026-10-25 | minor | LR-MASK-OVERLAY: one overlay rule (O / the eye, or the pointer on the mask's row or pin while nothing is adjusted, or a mask without settings yet); a mask with settings never shows by itself, so picking, creating, duplicating or adding to one no longer shows the overlay (#1800's re-show replaced, its test changed to the rule); sliders, mask drags and brush strokes hide it and the mask's lines and pins while at work; no stand-in overlay while an AI selection is computed; status unchanged (✅) |
|
||||
| 2026-10-30 | patch | LR-BEHAV-ACCESS: the Flatpak manifests grant `--talk-name=org.a11y.Bus`, so AccessKit can find out whether a screen reader is running and publish the window inside the sandbox; packaging lint requires it in both manifests; status unchanged (🟡), not tried with Orca |
|
||||
| 2026-10-27 | patch | LR-LIB-LABEL, MENU-PHOTO-LABEL, KEY-LABELS: Clear Color Label (`photo.clearLabel`) is a command of its own, so Help → Keyboard Shortcuts can give it a key (#2980); the Photo ▸ Set Color Label ▸ None row runs it; status unchanged |
|
||||
| 2026-10-25 | minor | KEYC-METADATA, LRC-LIB-KEYWORDS: ⌘⌥⇧K / Ctrl+Alt+Shift+K (`dialog.keywordShortcut`, Set Keyword Shortcut) and ⇧K (`keyword.toggleShortcut`) add and remove the keyword shortcut's keywords; Keyword Shortcut leaves LRC-LIB-KEYWORDS' Not yet list; status counts unchanged (KEYC-METADATA stays 🟡) |
|
||||
|
||||
@@ -467,6 +467,16 @@
|
||||
a keyword a line; LightCraft now reads it as one keyword a line, and repairs libraries that already hold such a
|
||||
keyword when they open. A name with a line break in it is drawn on one line in the sidebar and the Keyword List.
|
||||
|
||||
### The mask overlay shows when it helps
|
||||
- One rule now decides when a mask's overlay covers the photo: when you switch it on with **O** (or the eye by the
|
||||
Masks title), while the pointer is on one of the mask's parts (the rows under its name) or its pin, or by itself for a mask that
|
||||
has no settings yet, so you see what it selects. The pointer on the mask's own row shows nothing, so its eye
|
||||
switches the effect on and off with nothing over the photo. A mask with settings (its own or a preset's) never shows the overlay by itself, so you can
|
||||
judge its effect: picking, creating, duplicating or adding to such a mask no longer covers the photo. While a
|
||||
slider is at work nothing covers the photo, not even an overlay switched on with O; it comes back when you let go.
|
||||
During a mask drag or a brush stroke, hovering shows no overlay; an overlay switched on with O, or a mask without
|
||||
settings, keeps showing what it selects. While an Object click or a description is still being computed, no stand-in
|
||||
overlay shows.
|
||||
### Import rename numbering stops safely at its limit
|
||||
- Copy and Move imports can use the last representable rename number once. If more renamed files remain, each is
|
||||
reported as failed with guidance to lower `renameStart` or leave `rename` blank; completed transfers stay
|
||||
|
||||
Reference in new issue
Block a user