Skip to content

Commit 618cf7f

Browse files
authored
Remove useless Direction field (#14793)
# Objective Delete some code that isn't actually doing anything. This was actually discovered way back in this obsolete PR: #5513. Also Fixes #6286 ## Solution Delete it ## Alternatives Make `Direction` do things. But it's not totally clear to me if it's possible to override cosmic-text's unicode bidi stuff. ## Migration Guide `Style` no longer has a `direction` field, and `Direction` has been deleted. They didn't do anything, so you can delete any references to them as well.
1 parent e37bf18 commit 618cf7f

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

crates/bevy_ui/src/layout/convert.rs

-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ mod tests {
454454
right: Val::Percent(50.),
455455
top: Val::Px(12.),
456456
bottom: Val::Auto,
457-
direction: crate::Direction::Inherit,
458457
flex_direction: FlexDirection::ColumnReverse,
459458
flex_wrap: FlexWrap::WrapReverse,
460459
align_items: AlignItems::Baseline,

crates/bevy_ui/src/ui_node.rs

-37
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,6 @@ pub struct Style {
173173
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/overflow>
174174
pub overflow: Overflow,
175175

176-
/// Defines the text direction. For example, English is written LTR (left-to-right) while Arabic is written RTL (right-to-left).
177-
///
178-
/// Note: the corresponding CSS property also affects box layout order, but this isn't yet implemented in Bevy.
179-
///
180-
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/direction>
181-
pub direction: Direction,
182-
183176
/// The horizontal position of the left edge of the node.
184177
/// - For relatively positioned nodes, this is relative to the node's position as computed during regular layout.
185178
/// - For absolutely positioned nodes, this is relative to the *parent* node's bounding box.
@@ -435,7 +428,6 @@ impl Style {
435428
right: Val::Auto,
436429
top: Val::Auto,
437430
bottom: Val::Auto,
438-
direction: Direction::DEFAULT,
439431
flex_direction: FlexDirection::DEFAULT,
440432
flex_wrap: FlexWrap::DEFAULT,
441433
align_items: AlignItems::DEFAULT,
@@ -730,35 +722,6 @@ impl Default for JustifyContent {
730722
}
731723
}
732724

733-
/// Defines the text direction.
734-
///
735-
/// For example, English is written LTR (left-to-right) while Arabic is written RTL (right-to-left).
736-
#[derive(Copy, Clone, PartialEq, Eq, Debug, Reflect)]
737-
#[reflect(Default, PartialEq)]
738-
#[cfg_attr(
739-
feature = "serialize",
740-
derive(serde::Serialize, serde::Deserialize),
741-
reflect(Serialize, Deserialize)
742-
)]
743-
pub enum Direction {
744-
/// Inherit from parent node.
745-
Inherit,
746-
/// Text is written left to right.
747-
LeftToRight,
748-
/// Text is written right to left.
749-
RightToLeft,
750-
}
751-
752-
impl Direction {
753-
pub const DEFAULT: Self = Self::Inherit;
754-
}
755-
756-
impl Default for Direction {
757-
fn default() -> Self {
758-
Self::DEFAULT
759-
}
760-
}
761-
762725
/// Defines the layout model used by this node.
763726
///
764727
/// Part of the [`Style`] component.

0 commit comments

Comments
 (0)