Implement DrawOptions.set_alpha()

This commit is contained in:
pylbrecht 2019-06-20 10:21:50 +02:00 committed by Bastien Orivel
parent ba1fa0835f
commit 4aad4ff858
2 changed files with 3 additions and 3 deletions

View file

@ -358,7 +358,7 @@ pub enum DrawOptions {
#[cfg(feature = "canvas2d-azure")] #[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::DrawOptions), Azure(azure::azure_hl::DrawOptions),
#[cfg(feature = "canvas2d-raqote")] #[cfg(feature = "canvas2d-raqote")]
Raqote(()), Raqote(raqote::DrawOptions),
} }
#[derive(Clone)] #[derive(Clone)]

View file

@ -73,7 +73,7 @@ impl Backend for RaqoteBackend {
impl<'a> CanvasPaintState<'a> { impl<'a> CanvasPaintState<'a> {
pub fn new(_antialias: AntialiasMode) -> CanvasPaintState<'a> { pub fn new(_antialias: AntialiasMode) -> CanvasPaintState<'a> {
CanvasPaintState { CanvasPaintState {
draw_options: DrawOptions::Raqote(()), draw_options: DrawOptions::Raqote(raqote::DrawOptions::new()),
fill_style: Pattern::Raqote(()), fill_style: Pattern::Raqote(()),
stroke_style: Pattern::Raqote(()), stroke_style: Pattern::Raqote(()),
stroke_opts: StrokeOptions::Raqote(PhantomData), stroke_opts: StrokeOptions::Raqote(PhantomData),
@ -112,7 +112,7 @@ impl<'a> StrokeOptions<'a> {
impl DrawOptions { impl DrawOptions {
pub fn set_alpha(&mut self, _val: f32) { pub fn set_alpha(&mut self, _val: f32) {
match self { match self {
DrawOptions::Raqote(()) => unimplemented!(), DrawOptions::Raqote(draw_options) => draw_options.alpha = _val,
} }
} }
} }