Format the crop-orphan measurement
rustfmt wraps two tuples in dr_pipeline::orphan that the previous commit left on one line past the width limit. No change in behaviour.
This commit is contained in:
@@ -302,7 +302,10 @@ fn part_values<'r>(
|
|||||||
fn brush_values(strokes: &[Stroke], source: (u32, u32)) -> Vec<f32> {
|
fn brush_values(strokes: &[Stroke], source: (u32, u32)) -> Vec<f32> {
|
||||||
// Into units of the shorter edge, as `to_square` does, so a dab is round.
|
// Into units of the shorter edge, as `to_square` does, so a dab is round.
|
||||||
let short = source.0.min(source.1).max(1) as f32;
|
let short = source.0.min(source.1).max(1) as f32;
|
||||||
let scale = (source.0.max(1) as f32 / short, source.1.max(1) as f32 / short);
|
let scale = (
|
||||||
|
source.0.max(1) as f32 / short,
|
||||||
|
source.1.max(1) as f32 / short,
|
||||||
|
);
|
||||||
let square = |p: (f32, f32)| (p.0 * scale.0, p.1 * scale.1);
|
let square = |p: (f32, f32)| (p.0 * scale.0, p.1 * scale.1);
|
||||||
|
|
||||||
let cells: Vec<(f32, f32)> = lattice().map(square).collect();
|
let cells: Vec<(f32, f32)> = lattice().map(square).collect();
|
||||||
@@ -314,7 +317,12 @@ fn brush_values(strokes: &[Stroke], source: (u32, u32)) -> Vec<f32> {
|
|||||||
// Only cells inside the stroke's bounding box can be reached.
|
// Only cells inside the stroke's bounding box can be reached.
|
||||||
let (lo, hi) = points.iter().fold(
|
let (lo, hi) = points.iter().fold(
|
||||||
((f32::MAX, f32::MAX), (f32::MIN, f32::MIN)),
|
((f32::MAX, f32::MAX), (f32::MIN, f32::MIN)),
|
||||||
|(lo, hi), p| ((lo.0.min(p.0), lo.1.min(p.1)), (hi.0.max(p.0), hi.1.max(p.1))),
|
|(lo, hi), p| {
|
||||||
|
(
|
||||||
|
(lo.0.min(p.0), lo.1.min(p.1)),
|
||||||
|
(hi.0.max(p.0), hi.1.max(p.1)),
|
||||||
|
)
|
||||||
|
},
|
||||||
);
|
);
|
||||||
for (cell, dst) in cells.iter().zip(out.iter_mut()) {
|
for (cell, dst) in cells.iter().zip(out.iter_mut()) {
|
||||||
if cell.0 < lo.0 - r || cell.0 > hi.0 + r || cell.1 < lo.1 - r || cell.1 > hi.1 + r {
|
if cell.0 < lo.0 - r || cell.0 > hi.0 + r || cell.1 < lo.1 - r || cell.1 > hi.1 + r {
|
||||||
|
|||||||
Reference in New Issue
Block a user