pub enum LayoutSurface {
Cylinder {
radius: f32,
arc_x: f32,
perspective: Option<f32>,
rotate_x: Option<SurfaceAngle>,
rotate_y: Option<SurfaceAngle>,
},
Sphere {
radius: f32,
arc_x: f32,
arc_y: f32,
perspective: Option<f32>,
rotate_x: Option<SurfaceAngle>,
rotate_y: Option<SurfaceAngle>,
},
}Expand description
style.layout-surface (issue #387): the shape a container’s direct
children are projected onto at paint time, plus the one perspective and
turntable rotation shared by all of them. radius/arc-x/arc-y are
pixels/degrees, not Lengths — this bends a fixed layout, it does not
participate in it.
Cylinder only curves around its arc-x (a horizontal wrap, like a
scroll); a child’s vertical position is left exactly where taffy put it.
Sphere curves around both arc-x and arc-y, which is what a dome
needs. Neither closes into a full globe — arc-x/arc-y describe a
patch, typically well under 360°; wrapping dot data onto an actual closed
globe is dot_map’s projection: "orthographic" instead (a different
problem: culling a far hemisphere, not bending a flat grid).
Depth ordering. Children are painted in the same declaration/z-index
order as a flat container — a cell that curves behind another one does
not sort behind it. For an arc-x/arc-y patch well under 180° (the
intended use: a dome of cards, not a fully enclosing sphere) every child
still faces the camera, so this is not visible; a wide enough arc or
enough rotate-y to turn cells past the limb can make a far cell paint
over a near one. Tracked generally by #93, not solved here.
Variants§
Cylinder
Fields
perspective: Option<f32>Shared vanishing-point distance in pixels, None = orthographic
(curved, but no foreshortening).
rotate_x: Option<SurfaceAngle>rotate_y: Option<SurfaceAngle>Sphere
Fields
perspective: Option<f32>Shared vanishing-point distance in pixels, None = orthographic
(curved, but no foreshortening).
rotate_x: Option<SurfaceAngle>rotate_y: Option<SurfaceAngle>Implementations§
Source§impl LayoutSurface
impl LayoutSurface
Trait Implementations§
Source§impl Clone for LayoutSurface
impl Clone for LayoutSurface
Source§impl Debug for LayoutSurface
impl Debug for LayoutSurface
Source§impl<'de> Deserialize<'de> for LayoutSurface
impl<'de> Deserialize<'de> for LayoutSurface
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for LayoutSurface
impl JsonSchema for LayoutSurface
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for LayoutSurface
impl PartialEq for LayoutSurface
Source§impl Serialize for LayoutSurface
impl Serialize for LayoutSurface
impl StructuralPartialEq for LayoutSurface
Auto Trait Implementations§
impl Freeze for LayoutSurface
impl RefUnwindSafe for LayoutSurface
impl Send for LayoutSurface
impl Sync for LayoutSurface
impl Unpin for LayoutSurface
impl UnsafeUnpin for LayoutSurface
impl UnwindSafe for LayoutSurface
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more