Remove dead anchor.rs code (#3551)
# Objective - As noticed by @sheepyhead in #3526, `anchor.rs` is completely unused. ## Solution - Anchors away!
This commit is contained in:
parent
36390a80ec
commit
0bae5bb8f4
@ -1,46 +0,0 @@
|
|||||||
#[derive(Debug, Clone)]
|
|
||||||
pub struct Anchors {
|
|
||||||
pub left: f32,
|
|
||||||
pub right: f32,
|
|
||||||
pub bottom: f32,
|
|
||||||
pub top: f32,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Anchors {
|
|
||||||
pub const BOTTOM_FULL: Anchors = Anchors::new(0.0, 1.0, 0.0, 0.0);
|
|
||||||
pub const BOTTOM_LEFT: Anchors = Anchors::new(0.0, 0.0, 0.0, 0.0);
|
|
||||||
pub const BOTTOM_RIGHT: Anchors = Anchors::new(1.0, 1.0, 0.0, 0.0);
|
|
||||||
pub const CENTER: Anchors = Anchors::new(0.5, 0.5, 0.5, 0.5);
|
|
||||||
pub const CENTER_BOTTOM: Anchors = Anchors::new(0.5, 0.5, 0.0, 0.0);
|
|
||||||
pub const CENTER_FULL_HORIZONTAL: Anchors = Anchors::new(0.0, 1.0, 0.5, 0.5);
|
|
||||||
pub const CENTER_FULL_VERTICAL: Anchors = Anchors::new(0.5, 0.5, 0.0, 1.0);
|
|
||||||
pub const CENTER_LEFT: Anchors = Anchors::new(0.0, 0.0, 0.5, 0.5);
|
|
||||||
pub const CENTER_RIGHT: Anchors = Anchors::new(1.0, 1.0, 0.5, 0.5);
|
|
||||||
pub const CENTER_TOP: Anchors = Anchors::new(0.5, 0.5, 1.0, 1.0);
|
|
||||||
pub const FULL: Anchors = Anchors::new(0.0, 1.0, 0.0, 1.0);
|
|
||||||
pub const LEFT_FULL: Anchors = Anchors::new(0.0, 0.0, 0.0, 1.0);
|
|
||||||
pub const RIGHT_FULL: Anchors = Anchors::new(1.0, 1.0, 0.0, 1.0);
|
|
||||||
pub const TOP_FULL: Anchors = Anchors::new(0.0, 1.0, 1.0, 1.0);
|
|
||||||
pub const TOP_LEFT: Anchors = Anchors::new(0.0, 0.0, 1.0, 1.0);
|
|
||||||
pub const TOP_RIGHT: Anchors = Anchors::new(1.0, 1.0, 1.0, 1.0);
|
|
||||||
|
|
||||||
pub const fn new(left: f32, right: f32, bottom: f32, top: f32) -> Self {
|
|
||||||
Anchors {
|
|
||||||
left,
|
|
||||||
right,
|
|
||||||
bottom,
|
|
||||||
top,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for Anchors {
|
|
||||||
fn default() -> Self {
|
|
||||||
Anchors {
|
|
||||||
left: 0.0,
|
|
||||||
right: 0.0,
|
|
||||||
bottom: 0.0,
|
|
||||||
top: 0.0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,4 +1,3 @@
|
|||||||
mod anchors;
|
|
||||||
mod flex;
|
mod flex;
|
||||||
mod focus;
|
mod focus;
|
||||||
mod margins;
|
mod margins;
|
||||||
@ -9,7 +8,6 @@ pub mod entity;
|
|||||||
pub mod update;
|
pub mod update;
|
||||||
pub mod widget;
|
pub mod widget;
|
||||||
|
|
||||||
pub use anchors::*;
|
|
||||||
pub use flex::*;
|
pub use flex::*;
|
||||||
pub use focus::*;
|
pub use focus::*;
|
||||||
pub use margins::*;
|
pub use margins::*;
|
||||||
@ -18,7 +16,7 @@ pub use ui_node::*;
|
|||||||
|
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub use crate::{entity::*, ui_node::*, widget::Button, Anchors, Interaction, Margins};
|
pub use crate::{entity::*, ui_node::*, widget::Button, Interaction, Margins};
|
||||||
}
|
}
|
||||||
|
|
||||||
use bevy_app::prelude::*;
|
use bevy_app::prelude::*;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user