Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
not-fl3 committed Aug 23, 2024
1 parent ad5587a commit 0c160b9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
26 changes: 13 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ struct Context {

default_filter_mode: crate::quad_gl::FilterMode,
textures: crate::texture::TexturesContext,

update_on: conf::UpdateTrigger,
}

Expand Down Expand Up @@ -354,7 +354,7 @@ impl Context {

quad_context: ctx,

default_filter_mode: crate::quad_gl::FilterMode::Linear,
default_filter_mode: crate::quad_gl::FilterMode::Linear,
textures: crate::texture::TexturesContext::new(),
update_on: Default::default(),
}
Expand Down Expand Up @@ -805,17 +805,17 @@ pub mod conf {
/// zero CPU usage.
/// update_on will tell macroquad when to proceed with the event loop.
pub update_on: Option<UpdateTrigger>,
pub default_filter_mode: crate::FilterMode,
pub default_filter_mode: crate::FilterMode,
}

impl Default for Conf {
fn default() -> Self {
Self {
miniquad_conf: miniquad::conf::Conf::default(),
update_on: Some(UpdateTrigger::default()),
default_filter_mode: crate::FilterMode::Linear
}
}
fn default() -> Self {
Self {
miniquad_conf: miniquad::conf::Conf::default(),
update_on: Some(UpdateTrigger::default()),
default_filter_mode: crate::FilterMode::Linear,
}
}
}
}

Expand All @@ -824,7 +824,7 @@ impl From<miniquad::conf::Conf> for conf::Conf {
conf::Conf {
miniquad_conf: conf,
update_on: None,
default_filter_mode: crate::FilterMode::Linear,
default_filter_mode: crate::FilterMode::Linear,
}
}
}
Expand All @@ -851,7 +851,7 @@ impl Window {
let conf::Conf {
miniquad_conf,
update_on,
default_filter_mode,
default_filter_mode,
} = config.into();
miniquad::start(miniquad_conf, move || {
thread_assert::set_thread_id();
Expand All @@ -860,7 +860,7 @@ impl Window {
}
let mut context = Context::new();
context.update_on = update_on.unwrap_or_default();
context.default_filter_mode = default_filter_mode;
context.default_filter_mode = default_filter_mode;
unsafe { CONTEXT = Some(context) };

Box::new(Stage {})
Expand Down
2 changes: 1 addition & 1 deletion src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ pub fn load_ttf_font_from_bytes(bytes: &[u8]) -> Result<Font, Error> {
let ctx = get_context();

font.set_filter(ctx.default_filter_mode);

Ok(font)
}

Expand Down
10 changes: 5 additions & 5 deletions src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,12 +650,12 @@ impl Texture2D {
let bytes = img.into_raw();

let t = Self::from_rgba8(width, height, &bytes);

let ctx = get_context();

t.set_filter(ctx.default_filter_mode);

t
let ctx = get_context();

t.set_filter(ctx.default_filter_mode);

t
}

/// Creates a Texture2D from an [Image].
Expand Down

0 comments on commit 0c160b9

Please sign in to comment.