Wrap the lines the merge resolution left long
`cargo fmt --check` failed the desktop job, on three files and for one reason: routing the mask handlers through the `Masking` global was done by substituting the call prefix, which is a text edit rather than a Rust one. It left `window.global::<Masking>().on_part_join_picked(...)` on a line that had been short enough as `window.on_mask_part_join_picked(...)` and no longer was. Formatting only. The whitespace-stripped source is identical in the two `ui/` files; the third differs by the trailing commas rustfmt adds when it breaks a call across lines. The matrix moves with it, because the tags shift by a few lines and the check compares line numbers.
This commit is contained in:
@@ -98,7 +98,17 @@ fn main() {
|
||||
|
||||
// The reference frame: every parameter at its default. Written once so a
|
||||
// viewer can see what the sweep is departing from.
|
||||
render_to(&mut adjust, &image, &graph, w, h, &out_dir, "neutral", 0, 0.0);
|
||||
render_to(
|
||||
&mut adjust,
|
||||
&image,
|
||||
&graph,
|
||||
w,
|
||||
h,
|
||||
&out_dir,
|
||||
"neutral",
|
||||
0,
|
||||
0.0,
|
||||
);
|
||||
|
||||
// Parameters held away from their default for the duration, as
|
||||
// `SWEEP_HOLD=shadow_strength=70,midtone_hue=210`.
|
||||
@@ -172,7 +182,8 @@ fn render_to(
|
||||
// and the example never has to know which it was handed.
|
||||
let shader = graph.compose_for(ColourSpace::Srgb);
|
||||
let scale = graph.render_scale(image.size(), (w, h));
|
||||
let detail = graph.compose_detail_for(scale.full_size(), scale.render_size(), ColourSpace::Srgb);
|
||||
let detail =
|
||||
graph.compose_detail_for(scale.full_size(), scale.render_size(), ColourSpace::Srgb);
|
||||
let key = graph.invalidation().through(Affects::Colour);
|
||||
adjust
|
||||
.render_detailed(image, &shader, w, h, None, &detail, key)
|
||||
|
||||
+34
-34
File diff suppressed because one or more lines are too long
+1
-4
@@ -818,10 +818,7 @@ pub(crate) fn sync_film(window: &AppWindow, session: &Rc<RefCell<Option<DevelopS
|
||||
// Whether the picker belongs in the group on screen. Asked of the session
|
||||
// rather than decided here: it is a fact about what the operation is
|
||||
// about, and the answer moves if the descriptor ever does.
|
||||
let in_group = session
|
||||
.borrow()
|
||||
.as_ref()
|
||||
.is_none_or(|s| s.film_in_group());
|
||||
let in_group = session.borrow().as_ref().is_none_or(|s| s.film_in_group());
|
||||
|
||||
let can_print = choices
|
||||
.get(selected)
|
||||
|
||||
+41
-33
@@ -828,13 +828,15 @@ pub(crate) fn wire(
|
||||
{
|
||||
let weak = window.as_weak();
|
||||
let session = session.clone();
|
||||
window.global::<Masking>().on_brush_changed(move |radius, hardness, flow| {
|
||||
let Some(w) = weak.upgrade() else { return };
|
||||
if let Some(s) = session.borrow_mut().as_mut() {
|
||||
s.set_brush(radius, hardness, flow);
|
||||
}
|
||||
sync(&w, &session);
|
||||
});
|
||||
window
|
||||
.global::<Masking>()
|
||||
.on_brush_changed(move |radius, hardness, flow| {
|
||||
let Some(w) = weak.upgrade() else { return };
|
||||
if let Some(s) = session.borrow_mut().as_mut() {
|
||||
s.set_brush(radius, hardness, flow);
|
||||
}
|
||||
sync(&w, &session);
|
||||
});
|
||||
}
|
||||
{
|
||||
let weak = window.as_weak();
|
||||
@@ -854,15 +856,17 @@ pub(crate) fn wire(
|
||||
let session = session.clone();
|
||||
let redraw = redraw.clone();
|
||||
let rows = rows.clone();
|
||||
window.global::<Masking>().on_part_selected(move |_id, index| {
|
||||
let Some(w) = weak.upgrade() else { return };
|
||||
if let Some(s) = session.borrow_mut().as_mut() {
|
||||
s.set_active_part(index.max(0) as usize);
|
||||
}
|
||||
sync(&w, &session);
|
||||
sync_rows(&w, &rows, &session);
|
||||
redraw(&w);
|
||||
});
|
||||
window
|
||||
.global::<Masking>()
|
||||
.on_part_selected(move |_id, index| {
|
||||
let Some(w) = weak.upgrade() else { return };
|
||||
if let Some(s) = session.borrow_mut().as_mut() {
|
||||
s.set_active_part(index.max(0) as usize);
|
||||
}
|
||||
sync(&w, &session);
|
||||
sync_rows(&w, &rows, &session);
|
||||
redraw(&w);
|
||||
});
|
||||
}
|
||||
{
|
||||
let weak = window.as_weak();
|
||||
@@ -890,28 +894,32 @@ pub(crate) fn wire(
|
||||
let session = session.clone();
|
||||
let redraw = redraw.clone();
|
||||
let rows = rows.clone();
|
||||
window.global::<Masking>().on_part_removed(move |id, index| {
|
||||
let Some(w) = weak.upgrade() else { return };
|
||||
if let Some(s) = session.borrow_mut().as_mut() {
|
||||
s.remove_mask_part(&id, index.max(0) as usize);
|
||||
}
|
||||
sync(&w, &session);
|
||||
sync_rows(&w, &rows, &session);
|
||||
redraw(&w);
|
||||
});
|
||||
window
|
||||
.global::<Masking>()
|
||||
.on_part_removed(move |id, index| {
|
||||
let Some(w) = weak.upgrade() else { return };
|
||||
if let Some(s) = session.borrow_mut().as_mut() {
|
||||
s.remove_mask_part(&id, index.max(0) as usize);
|
||||
}
|
||||
sync(&w, &session);
|
||||
sync_rows(&w, &rows, &session);
|
||||
redraw(&w);
|
||||
});
|
||||
}
|
||||
{
|
||||
let weak = window.as_weak();
|
||||
let session = session.clone();
|
||||
let redraw = redraw.clone();
|
||||
window.global::<Masking>().on_part_join_picked(move |id, index, join| {
|
||||
let Some(w) = weak.upgrade() else { return };
|
||||
if let Some(s) = session.borrow_mut().as_mut() {
|
||||
s.set_mask_part_join(&id, index.max(0) as usize, join.max(0) as usize);
|
||||
}
|
||||
sync(&w, &session);
|
||||
redraw(&w);
|
||||
});
|
||||
window
|
||||
.global::<Masking>()
|
||||
.on_part_join_picked(move |id, index, join| {
|
||||
let Some(w) = weak.upgrade() else { return };
|
||||
if let Some(s) = session.borrow_mut().as_mut() {
|
||||
s.set_mask_part_join(&id, index.max(0) as usize, join.max(0) as usize);
|
||||
}
|
||||
sync(&w, &session);
|
||||
redraw(&w);
|
||||
});
|
||||
}
|
||||
{
|
||||
let weak = window.as_weak();
|
||||
|
||||
Reference in New Issue
Block a user