Skip to content

Commit 35ceded

Browse files
committed
formatting
1 parent a465c9f commit 35ceded

File tree

7 files changed

+11
-17
lines changed

7 files changed

+11
-17
lines changed

src/components/microphone.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use bevy::prelude::*;
2-
use bevy_pixel_buffer::bevy_egui::egui::emath::Pos2;
32
use egui::epaint::CircleShape;
4-
use egui::{Color32, Rect};
3+
use egui::{Color32, Pos2, Rect};
54
use serde::{Deserialize, Serialize};
65

76
use super::gizmo::GizmoComponent;

src/components/states.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
use bevy::ecs::component::Component;
2-
use bevy_pixel_buffer::bevy_egui::egui::emath::Pos2;
3-
use bevy_pixel_buffer::bevy_egui::egui::{Color32, Rect};
42

53
#[derive(Component)]
64
pub struct Drag;

src/input/input.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ pub fn button_input(
196196
if (resize_point.x).abs_diff(x) <= 10
197197
&& (resize_point.y).abs_diff(y) <= 10
198198
{
199-
commands.entity(entity).insert((resize_type));
199+
commands.entity(entity).insert(resize_type);
200200
break;
201201
}
202202
}
@@ -206,7 +206,7 @@ pub fn button_input(
206206
if (resize_point.x).abs_diff(x) <= 10
207207
&& (resize_point.y).abs_diff(y) <= 10
208208
{
209-
commands.entity(entity).insert((WResize::Radius));
209+
commands.entity(entity).insert(WResize::Radius);
210210
break;
211211
}
212212
}

src/math/transformations.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use bevy_pixel_buffer::bevy_egui::egui::emath::Rect;
2-
use egui::{pos2, Pos2};
1+
use egui::{Pos2, Rect};
32

43
use super::constants::*;
54
use crate::ui::state::UiState;
@@ -87,7 +86,7 @@ pub fn screen_to_nearest_grid(x: f32, y: f32, image_rect: Rect) -> Option<(u32,
8786
}
8887

8988
pub fn grid_to_image(pos: Pos2, image_rect: &Rect) -> Pos2 {
90-
pos2(
89+
Pos2::new(
9190
f32_map_range(
9291
0.,
9392
SIMULATION_WIDTH as f32,

src/ui/dialog.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::grid::grid::Grid;
1212
/// Marker component for the file dialog and the corresponding event.
1313
pub struct SaveFileContents;
1414

15-
1615
/// The data that is loaded from a file. Used for deserialization.
1716
#[derive(Deserialize)]
1817
pub struct SaveData {

src/ui/draw.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use bevy::diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin};
22
use bevy::prelude::*;
33
use bevy_file_dialog::prelude::*;
4-
use bevy_pixel_buffer::bevy_egui::egui::epaint::CircleShape;
5-
use bevy_pixel_buffer::bevy_egui::egui::{pos2, Color32, Frame, Margin, Vec2};
4+
use bevy_pixel_buffer::bevy_egui::egui::{Color32, Frame, Margin, Vec2};
65
use bevy_pixel_buffer::bevy_egui::EguiContexts;
76
use bevy_pixel_buffer::prelude::*;
87
use egui_plot::{GridMark, Legend, Line, Plot, PlotPoints};
@@ -12,12 +11,12 @@ use crate::components::gizmo::GizmoComponent;
1211
use crate::components::microphone::*;
1312
use crate::components::source::*;
1413
use crate::components::states::{MenuSelected, Selected};
15-
use crate::components::wall::{CircWall, RectWall, WResize, Wall};
14+
use crate::components::wall::{CircWall, RectWall, Wall};
1615
use crate::events::UpdateWalls;
1716
use crate::grid::grid::Grid;
1817
use crate::math::constants::*;
1918
use crate::math::fft::calc_mic_spectrum;
20-
use crate::math::transformations::{coords_to_index, f32_map_range};
19+
use crate::math::transformations::coords_to_index;
2120
use crate::render::draw::GradientResource;
2221
use crate::ui::state::*;
2322

src/ui/state.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::fmt;
22

33
use bevy::prelude::*;
4-
use bevy_pixel_buffer::bevy_egui::egui::Vec2;
4+
use egui::Vec2;
55

66
#[derive(Debug, PartialEq, Clone, Copy)]
77
pub enum WallType {
@@ -72,7 +72,7 @@ pub struct UiState {
7272
pub render_abc_area: bool,
7373
pub at_type: AttenuationType,
7474
pub power_order: u32,
75-
pub image_rect: egui::emath::Rect,
75+
pub image_rect: egui::Rect,
7676
pub show_plots: bool,
7777
pub current_fft_microphone: Option<usize>,
7878
pub spectrum_size: Vec2,
@@ -94,7 +94,7 @@ impl Default for UiState {
9494
render_abc_area: false,
9595
at_type: AttenuationType::Power,
9696
power_order: 5,
97-
image_rect: egui::emath::Rect::NOTHING,
97+
image_rect: egui::Rect::NOTHING,
9898
show_plots: false,
9999
current_fft_microphone: None,
100100
spectrum_size: Vec2 { x: 250., y: 500. }, // random init values

0 commit comments

Comments
 (0)