pub struct RectShape {
pub rect: Rect,
pub rounding: Rounding,
pub fill: Color32,
pub stroke: Stroke,
pub fill_texture_id: TextureId,
pub uv: Rect,
}Expand description
How to paint a rectangle.
Fields§
§rect: Rect§rounding: RoundingHow rounded the corners are. Use Rounding::ZERO for no rounding.
fill: Color32How to fill the rectangle.
stroke: StrokeThe thickness and color of the outline.
fill_texture_id: TextureIdIf the rect should be filled with a texture, which one?
The texture is multiplied with Self::fill.
uv: RectWhat UV coordinates to use for the texture?
To display a texture, set Self::fill_texture_id,
and set this to Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)).
Use Rect::ZERO to turn off texturing.
Implementations§
Source§impl RectShape
impl RectShape
pub fn new( rect: Rect, rounding: impl Into<Rounding>, fill_color: impl Into<Color32>, stroke: impl Into<Stroke>, ) -> RectShape
pub fn filled( rect: Rect, rounding: impl Into<Rounding>, fill_color: impl Into<Color32>, ) -> RectShape
pub fn stroke( rect: Rect, rounding: impl Into<Rounding>, stroke: impl Into<Stroke>, ) -> RectShape
Sourcepub fn visual_bounding_rect(&self) -> Rect
pub fn visual_bounding_rect(&self) -> Rect
The visual bounding rectangle (includes stroke width)
Trait Implementations§
impl Copy for RectShape
impl StructuralPartialEq for RectShape
Auto Trait Implementations§
impl Freeze for RectShape
impl RefUnwindSafe for RectShape
impl Send for RectShape
impl Sync for RectShape
impl Unpin for RectShape
impl UnwindSafe for RectShape
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> ⓘ
Converts
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> ⓘ
Converts
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