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: LineCaplineCap。
line_join: LineJoinlineJoin。
miter_limit: f32miterLimit。
line_dash: Vec<f32>setLineDash のパターン。空なら実線。
line_dash_offset: f32lineDashOffset。
clip: Option<Arc<ClipMask>>クリップ領域。None なら全面。
global_alpha: f32globalAlpha(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§
Auto Trait Implementations§
impl Freeze for DrawState
impl RefUnwindSafe for DrawState
impl Send for DrawState
impl Sync for DrawState
impl Unpin for DrawState
impl UnsafeUnpin for DrawState
impl UnwindSafe for DrawState
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