Skip to main content

DrawState

Struct DrawState 

Source
pub struct DrawState {
Show 21 fields pub transform: Matrix, pub fill: u32, pub fill_str: String, pub stroke: u32, pub stroke_str: String, pub line_width: f32, pub line_cap: LineCap, pub line_join: LineJoin, pub miter_limit: f32, pub line_dash: Vec<f32>, pub line_dash_offset: f32, pub clip: Option<Arc<ClipMask>>, pub global_alpha: f32, pub font_str: String, pub text_align_str: String, pub text_baseline_str: String, pub image_smoothing_enabled: bool, pub fill_gradient: Option<CanvasGradient>, pub stroke_gradient: Option<CanvasGradient>, pub fill_pattern: Option<CanvasPattern>, pub stroke_pattern: Option<CanvasPattern>,
}
Expand description

save()/restore() で退避・復帰する描画状態。

Fields§

§transform: Matrix§fill: u32

塗り色(ARGB8888)。

§fill_str: String

塗り色の文字列表現(例: “#000000”, “red”)。

§stroke: u32

線色(ARGB8888)。

§stroke_str: String

線色の文字列表現。

§line_width: f32§line_cap: LineCap

lineCap。

§line_join: LineJoin

lineJoin。

§miter_limit: f32

miterLimit。

§line_dash: Vec<f32>

setLineDash のパターン。空なら実線。

§line_dash_offset: f32

lineDashOffset。

§clip: Option<Arc<ClipMask>>

クリップ領域。None なら全面。

§global_alpha: f32

globalAlpha(0.0〜1.0)。

§font_str: String

フォント指定文字列(例: “10px sans-serif”)。

§text_align_str: String

水平揃え文字列(例: “start”)。

§text_baseline_str: String

垂直ベースライン文字列(例: “alphabetic”)。

§image_smoothing_enabled: bool

画像平滑化有効フラグ(imageSmoothingEnabled)。

§fill_gradient: Option<CanvasGradient>

塗りグラデーション(指定時は単色 fill より優先)。

§stroke_gradient: Option<CanvasGradient>

線グラデーション。

§fill_pattern: Option<CanvasPattern>

塗りパターン(指定時は単色 fill より優先)。

§stroke_pattern: Option<CanvasPattern>

線パターン。

Trait Implementations§

Source§

impl Clone for DrawState

Source§

fn clone(&self) -> DrawState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DrawState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DrawState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.