Refactor alignment types into an alignment module
This commit is contained in:
parent
5fae6e59ff
commit
a0ad399622
54 changed files with 402 additions and 377 deletions
|
|
@ -1,10 +1,10 @@
|
|||
//! Organize rendering primitives into a flattened list of layers.
|
||||
use crate::alignment;
|
||||
use crate::image;
|
||||
use crate::svg;
|
||||
use crate::triangle;
|
||||
use crate::{
|
||||
Background, Font, HorizontalAlignment, Point, Primitive, Rectangle, Size,
|
||||
Vector, VerticalAlignment, Viewport,
|
||||
Background, Font, Point, Primitive, Rectangle, Size, Vector, Viewport,
|
||||
};
|
||||
|
||||
/// A group of primitives that should be clipped together.
|
||||
|
|
@ -55,8 +55,8 @@ impl<'a> Layer<'a> {
|
|||
color: [0.9, 0.9, 0.9, 1.0],
|
||||
size: 20.0,
|
||||
font: Font::Default,
|
||||
horizontal_alignment: HorizontalAlignment::Left,
|
||||
vertical_alignment: VerticalAlignment::Top,
|
||||
horizontal_alignment: alignment::Horizontal::Left,
|
||||
vertical_alignment: alignment::Vertical::Top,
|
||||
};
|
||||
|
||||
overlay.text.push(text);
|
||||
|
|
@ -293,10 +293,10 @@ pub struct Text<'a> {
|
|||
pub font: Font,
|
||||
|
||||
/// The horizontal alignment of the [`Text`].
|
||||
pub horizontal_alignment: HorizontalAlignment,
|
||||
pub horizontal_alignment: alignment::Horizontal,
|
||||
|
||||
/// The vertical alignment of the [`Text`].
|
||||
pub vertical_alignment: VerticalAlignment,
|
||||
pub vertical_alignment: alignment::Vertical,
|
||||
}
|
||||
|
||||
/// A raster or vector image.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue