pub struct Path { /* private fields */ }Expand description
Path widget describe a shape, build the shape from [Builder]!
Implementations§
Source§impl Path
impl Path
pub fn builder() -> PathBuilder
pub fn bounds(&self) -> &Rect<f32, LogicUnit>
Sourcepub fn rect_round(rect: &Rect<f32, LogicUnit>, radius: &Radius) -> Path
pub fn rect_round(rect: &Rect<f32, LogicUnit>, radius: &Radius) -> Path
Creates a path for a rectangle by rect with radius.
#[inline]
Sourcepub fn stroke(
&self,
options: &StrokeOptions,
ts: Option<&Transform2D<f32, LogicUnit, LogicUnit>>,
) -> Option<Path>
pub fn stroke( &self, options: &StrokeOptions, ts: Option<&Transform2D<f32, LogicUnit, LogicUnit>>, ) -> Option<Path>
Convert this path to a stroked path
ts is the current transform of the path pre applied. Provide it have a
more precise convert.
Sourcepub fn transform(self, ts: &Transform2D<f32, LogicUnit, LogicUnit>) -> Path
pub fn transform(self, ts: &Transform2D<f32, LogicUnit, LogicUnit>) -> Path
Returns a transformed path in place.
Some points may become NaN/inf therefore this method can fail.
Sourcepub fn sampler(&self) -> PathSampler
pub fn sampler(&self) -> PathSampler
Create an sampler that can queries point at this path or usb-path of this path.
pub fn segments(&self) -> impl Iterator<Item = PathSegment>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Path
impl<'de> Deserialize<'de> for Path
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Path, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Path, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Path
impl Serialize for Path
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnsafeUnpin for Path
impl UnwindSafe for Path
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.