pub struct Edges {
pub left: f32,
pub right: f32,
pub top: f32,
pub bottom: f32,
pub inline_start: Option<f32>,
pub inline_end: Option<f32>,
pub block_start: Option<f32>,
pub block_end: Option<f32>,
pub pct_left: Option<f32>,
pub pct_right: Option<f32>,
pub pct_top: Option<f32>,
pub pct_bottom: Option<f32>,
}Expand description
Per-edge length values (padding, margin, border). Physical edges
(left / right / top / bottom) carry the authored values; the
optional *_inline_* / *_block_* fields override them per writing
direction (W5.5 - CSS Logical Properties Level 1 subset).
Edges::resolved(dir) collapses the logical fields onto the
physical ones for the layout backend. When a logical override is
None the physical field wins (back-compat for every existing
callsite).
PartialEq is hand-written with NaN-tolerant semantics: NaN is the
canonical “unset / auto” sentinel for inset edges (edges_to_lpa
NaN-checks), and IEEE NaN != NaN made any two identical auto-inset
styles compare unequal - which defeated every “did the Style actually
change?” gate downstream (the taffy style cache re-pushed all
virtualized rows on every dirty tick; equality-gated Style inserts
re-fired forever).
Fields§
§left: f32Left edge.
right: f32Right edge.
top: f32Top edge.
bottom: f32Bottom edge.
inline_start: Option<f32>*-inline-start - maps to left under LTR, right under RTL.
inline_end: Option<f32>*-inline-end - maps to right under LTR, left under RTL.
block_start: Option<f32>*-block-start - alias for top (no vertical writing modes yet).
block_end: Option<f32>*-block-end - alias for bottom.
pct_left: Option<f32>CSS percent unit for the left edge. When Some(pct) the side
resolves as pct% per CSS (padding/margin percentages resolve
against the containing block’s width; the layout backend hands
taffy a LengthPercentage::percent) and the px field for the
side is ignored. None = the px field is authoritative (fast
path, unchanged behaviour).
pct_right: Option<f32>See Self::pct_left.
pct_top: Option<f32>See Self::pct_left.
pct_bottom: Option<f32>See Self::pct_left.
Implementations§
Source§impl Edges
impl Edges
Sourcepub fn resolved(&self, dir: LayoutDirection) -> Self
pub fn resolved(&self, dir: LayoutDirection) -> Self
Resolve logical overrides onto the physical sides under dir.
Returns a fresh Edges whose left / right / top /
bottom are the values the layout backend should use; the
Option fields are cleared so a second call is idempotent.
inline_startwritesleft(LTR) orright(RTL).inline_endwritesright(LTR) orleft(RTL).block_startwritestop;block_endwritesbottom.LayoutDirection::Autois treated as LTR (the cascade resolver should have stamped a concrete direction before this is reached; the fallback keeps this fn total).
Trait Implementations§
impl Copy for Edges
Auto Trait Implementations§
impl Freeze for Edges
impl RefUnwindSafe for Edges
impl Send for Edges
impl Sync for Edges
impl Unpin for Edges
impl UnsafeUnpin for Edges
impl UnwindSafe for Edges
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.