cargo fmt

This commit is contained in:
Hakan committed 2026-05-12 10:36:15 +03:00
1 parent 468cbde5e1
commit ca07268c7c
204 files changed
+13997 -5525

No files matched your search

+12 -10
View File
@@ -65,13 +65,20 @@ impl<'a> canvas::Program<Message> for PaperCanvas<'a> {
let mut frame = canvas::Frame::new(renderer, bounds.size());
// ── Desk background (area outside the paper sheet) ────────────────────
const DESK: Color = Color { r: 0.22, g: 0.24, b: 0.28, a: 1.0 };
const DESK: Color = Color {
r: 0.22,
g: 0.24,
b: 0.28,
a: 1.0,
};
frame.fill_rectangle(Point::ORIGIN, bounds.size(), DESK);
// ── White paper area — use layout paper limits (actual paper size).
if let Some(((px0, py0), (px1, py1))) = self.scene.paper_limits().map(
|((x0, y0), (x1, y1))| ((x0 as f32, y0 as f32), (x1 as f32, y1 as f32)),
) {
if let Some(((px0, py0), (px1, py1))) = self
.scene
.paper_limits()
.map(|((x0, y0), (x1, y1))| ((x0 as f32, y0 as f32), (x1 as f32, y1 as f32)))
{
let tl = to_px(px0, py1);
let br = to_px(px1, py0);
let pw = br.x - tl.x;
@@ -156,11 +163,7 @@ impl<'a> canvas::Program<Message> for PaperCanvas<'a> {
/// Draw one HatchModel (solid, gradient, or pattern) onto `frame`.
/// Patterns and gradients are approximated as solid fills in 2-D canvas mode.
fn draw_hatch(
frame: &mut canvas::Frame,
hatch: &HatchModel,
to_px: &impl Fn(f32, f32) -> Point,
) {
fn draw_hatch(frame: &mut canvas::Frame, hatch: &HatchModel, to_px: &impl Fn(f32, f32) -> Point) {
if hatch.boundary.is_empty() {
return;
}
@@ -204,4 +207,3 @@ fn draw_hatch(
}
}
}