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
|
|
@ -7,8 +7,9 @@ use iced_graphics::backend;
|
|||
use iced_graphics::font;
|
||||
use iced_graphics::Layer;
|
||||
use iced_graphics::Primitive;
|
||||
use iced_native::alignment;
|
||||
use iced_native::mouse;
|
||||
use iced_native::{Font, HorizontalAlignment, Size, VerticalAlignment};
|
||||
use iced_native::{Font, Size};
|
||||
|
||||
/// A [`glow`] graphics backend for [`iced`].
|
||||
///
|
||||
|
|
@ -147,24 +148,24 @@ impl Backend {
|
|||
}],
|
||||
layout: glow_glyph::Layout::default()
|
||||
.h_align(match text.horizontal_alignment {
|
||||
HorizontalAlignment::Left => {
|
||||
alignment::Horizontal::Left => {
|
||||
glow_glyph::HorizontalAlign::Left
|
||||
}
|
||||
HorizontalAlignment::Center => {
|
||||
alignment::Horizontal::Center => {
|
||||
glow_glyph::HorizontalAlign::Center
|
||||
}
|
||||
HorizontalAlignment::Right => {
|
||||
alignment::Horizontal::Right => {
|
||||
glow_glyph::HorizontalAlign::Right
|
||||
}
|
||||
})
|
||||
.v_align(match text.vertical_alignment {
|
||||
VerticalAlignment::Top => {
|
||||
alignment::Vertical::Top => {
|
||||
glow_glyph::VerticalAlign::Top
|
||||
}
|
||||
VerticalAlignment::Center => {
|
||||
alignment::Vertical::Center => {
|
||||
glow_glyph::VerticalAlign::Center
|
||||
}
|
||||
VerticalAlignment::Bottom => {
|
||||
alignment::Vertical::Bottom => {
|
||||
glow_glyph::VerticalAlign::Bottom
|
||||
}
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -29,10 +29,9 @@ pub(crate) use iced_graphics::Transformation;
|
|||
pub use widget::*;
|
||||
|
||||
pub use iced_graphics::{Error, Viewport};
|
||||
pub use iced_native::{
|
||||
Background, Color, Command, HorizontalAlignment, Length, Vector,
|
||||
VerticalAlignment,
|
||||
};
|
||||
|
||||
pub use iced_native::alignment;
|
||||
pub use iced_native::{Alignment, Background, Color, Command, Length, Vector};
|
||||
|
||||
/// A [`glow`] graphics renderer for [`iced`].
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue