pub struct GradientRotation {
pub radians: f64,
}Expand description
A GradientTransform that rotates the gradient around the center-point of
its bounding box.
This sample would rotate a sweep gradient by a quarter turn clockwise:
ⓘ
SweepGradient::new(vec![Color::new(0xFFFFFFFF), Color::new(0xFF009900)])
.transform(GradientRotation::new(PI / 4.0));Fields§
§radians: f64The angle of rotation in radians in the clockwise direction.
Implementations§
Source§impl GradientRotation
impl GradientRotation
Sourcepub const fn new(radians: f64) -> GradientRotation
pub const fn new(radians: f64) -> GradientRotation
Constructs a GradientRotation for the specified angle.
The angle is in radians in the clockwise direction.
Trait Implementations§
Source§impl Clone for GradientRotation
impl Clone for GradientRotation
Source§fn clone(&self) -> GradientRotation
fn clone(&self) -> GradientRotation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GradientRotation
Source§impl Debug for GradientRotation
impl Debug for GradientRotation
Source§impl From<GradientRotation> for Rc<dyn GradientTransform>
impl From<GradientRotation> for Rc<dyn GradientTransform>
Source§fn from(rotation: GradientRotation) -> Rc<dyn GradientTransform>
fn from(rotation: GradientRotation) -> Rc<dyn GradientTransform>
Converts to this type from the input type.
Source§impl GradientTransform for GradientRotation
impl GradientTransform for GradientRotation
Source§fn transform(
&self,
bounds: Rect,
_text_direction: Option<TextDirection>,
) -> Option<Matrix>
fn transform( &self, bounds: Rect, _text_direction: Option<TextDirection>, ) -> Option<Matrix>
When a
Gradient creates its Shader, it will call this method to
determine what transform to apply to the shader for the given Rect and
TextDirection. Read moreSource§fn eq_transform(&self, other: &(dyn GradientTransform + 'static)) -> bool
fn eq_transform(&self, other: &(dyn GradientTransform + 'static)) -> bool
Field equality. Dart’s default
== is identity; subclasses that override
== implement this.Source§impl PartialEq for GradientRotation
impl PartialEq for GradientRotation
impl StructuralPartialEq for GradientRotation
Auto Trait Implementations§
impl Forget for GradientRotation
impl Freeze for GradientRotation
impl Move for GradientRotation
impl RefUnwindSafe for GradientRotation
impl Send for GradientRotation
impl Sync for GradientRotation
impl Unpin for GradientRotation
impl UnsafeUnpin for GradientRotation
impl UnwindSafe for GradientRotation
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