Skip to content

Commit 50c8feb

Browse files
macnellynot-fl3
authored andcommitted
cargo fmt
1 parent 6405334 commit 50c8feb

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/audio.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ mod dummy_audio {
4040

4141
pub fn set_volume(&mut self, _ctx: &mut AudioContext, _volume: f32) {}
4242

43-
44-
pub fn is_loaded(&self) -> bool{
43+
pub fn is_loaded(&self) -> bool {
4544
false
4645
}
4746

48-
pub fn delete(&self, _ctx: &AudioContext){}
47+
pub fn delete(&self, _ctx: &AudioContext) {}
4948
}
5049
}
5150

src/text.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ impl Default for TextParams {
243243

244244
/// Load font from file with "path"
245245
pub async fn load_ttf_font(path: &str) -> Result<Font, FontError> {
246-
let bytes = crate::file::load_file(path).await.map_err(|_| "The Font file couldn't be loaded")?;
246+
let bytes = crate::file::load_file(path)
247+
.await
248+
.map_err(|_| "The Font file couldn't be loaded")?;
247249

248250
load_ttf_font_from_bytes(&bytes[..])
249251
}

src/ui/render/painter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ impl Painter {
271271
let text_measures = self.label_size(data, None, font, font_size);
272272

273273
let left_coord = (element_size.x - text_measures.width) / 2.;
274-
let top_coord =
275-
element_size.y / 2. - text_measures.height / 2. + text_measures.offset_y / crate::get_quad_context().dpi_scale();
274+
let top_coord = element_size.y / 2. - text_measures.height / 2.
275+
+ text_measures.offset_y / crate::get_quad_context().dpi_scale();
276276

277277
self.draw_label(
278278
&*data,

src/ui/widgets/editbox.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
#[cfg(target_os = "android")]
2+
use crate::get_quad_context;
13
use crate::{
24
math::{vec2, Rect, Vec2},
35
ui::{ElementState, Id, InputCharacter, Key, KeyCode, Layout, Ui},
46
};
5-
#[cfg(target_os = "android")]
6-
use crate::get_quad_context;
77

88
pub struct Editbox<'a> {
99
id: Id,

0 commit comments

Comments
 (0)