Run cargo fmt

This commit is contained in:
Héctor Ramón Jiménez 2022-11-03 04:35:16 +01:00
parent 20a0577034
commit b957453404
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
17 changed files with 95 additions and 107 deletions

View file

@ -103,7 +103,7 @@ pub struct Builder {
start: Point,
end: Point,
stops: Vec<ColorStop>,
error: Option<BuilderError>
error: Option<BuilderError>,
}
impl Builder {
@ -126,7 +126,7 @@ impl Builder {
start,
end,
stops: vec![],
error: None
error: None,
}
}
@ -148,7 +148,7 @@ impl Builder {
}) {
Ok(_) => {
self.error = Some(BuilderError::DuplicateOffset(offset))
},
}
Err(index) => {
self.stops.insert(index, ColorStop { offset, color });
}

View file

@ -1,17 +1,17 @@
//! Organize rendering primitives into a flattened list of layers.
mod image;
pub mod mesh;
mod quad;
mod text;
mod image;
use crate::alignment;
use crate::{
Background, Font, Point, Primitive, Rectangle, Size, Vector, Viewport,
};
pub use crate::layer::image::Image;
pub use crate::layer::mesh::Mesh;
pub use crate::layer::quad::Quad;
pub use crate::layer::text::Text;
use crate::{
Background, Font, Point, Primitive, Rectangle, Size, Vector, Viewport,
};
/// A group of primitives that should be clipped together.
#[derive(Debug)]
@ -178,14 +178,12 @@ impl<'a> Layer<'a> {
// Only draw visible content
if let Some(clip_bounds) = layer.bounds.intersection(&bounds) {
layer.meshes.push(
Mesh {
origin: Point::new(translation.x, translation.y),
buffers,
clip_bounds,
style,
}
);
layer.meshes.push(Mesh {
origin: Point::new(translation.x, translation.y),
buffers,
clip_bounds,
style,
});
}
}
Primitive::Clip { bounds, content } => {
@ -244,4 +242,4 @@ impl<'a> Layer<'a> {
}
}
}
}
}

View file

@ -1,5 +1,5 @@
use iced_native::{image, svg};
use crate::Rectangle;
use iced_native::{image, svg};
/// A raster or vector image.
#[derive(Debug, Clone)]

View file

@ -29,13 +29,13 @@ mod viewport;
pub mod backend;
pub mod font;
pub mod gradient;
pub mod layer;
pub mod overlay;
pub mod renderer;
pub mod triangle;
pub mod widget;
pub mod window;
pub mod gradient;
pub use antialiasing::Antialiasing;
pub use backend::Backend;

View file

@ -2,8 +2,8 @@ use iced_native::image;
use iced_native::svg;
use iced_native::{Background, Color, Font, Rectangle, Size, Vector};
use crate::{alignment, layer::mesh};
use crate::triangle;
use crate::{alignment, layer::mesh};
use std::sync::Arc;

View file

@ -9,12 +9,12 @@ pub mod path;
mod cache;
mod cursor;
pub mod fill;
pub(crate) mod frame;
mod geometry;
mod program;
mod text;
pub mod fill;
pub mod stroke;
pub(crate) mod frame;
mod text;
pub use cache::Cache;
pub use cursor::Cursor;
@ -27,8 +27,8 @@ pub use program::Program;
pub use stroke::{LineCap, LineDash, LineJoin, Stroke};
pub use text::Text;
use crate::{Backend, Primitive, Renderer};
pub use crate::gradient::{self, Gradient};
use crate::{Backend, Primitive, Renderer};
use iced_native::layout::{self, Layout};
use iced_native::mouse;