Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
rewin123 committed Sep 14, 2024
1 parent 1a39051 commit 9154aa0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion crates/editor_ui/src/inspector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl EditorTab for InspectorTab {
egui::Window::new("Add component")
.open(&mut state.show_add_component_window)
.resizable(true)
.scroll2([false, true])
.scroll([false, true])
.default_width(120.)
.default_height(300.)
.default_pos(components_area.inner_rect.center_bottom())
Expand Down
8 changes: 3 additions & 5 deletions crates/editor_ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ pub mod sizing;

pub mod icons;

use std::char::MAX;

use bevy_debug_grid::{Grid, GridAxis, SubGrid, TrackedGrid};
use bevy_mod_picking::{
backends::raycast::RaycastPickable,
Expand Down Expand Up @@ -371,9 +369,9 @@ pub fn simple_editor_setup(mut commands: Commands) {
},
// Darker grid to make it easier to see entity gizmos when Transform (0, 0, 0)
GridAxis {
x: Some(Color::rgb(0.9, 0.1, 0.1)),
y: Some(Color::rgb(0.1, 0.9, 0.1)),
z: Some(Color::rgb(0.1, 0.1, 0.9)),
x: Some(Color::linear_rgb(0.9, 0.1, 0.1)),
y: Some(Color::linear_rgb(0.1, 0.9, 0.1)),
z: Some(Color::linear_rgb(0.1, 0.1, 0.9)),
},
TrackedGrid::default(),
TransformBundle::default(),
Expand Down
6 changes: 3 additions & 3 deletions crates/editor_ui/src/meshless_visualizer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::anyhow;
use bevy::{
math::{primitives as math_shapes, Direction3d},
math::primitives as math_shapes,
prelude::*,
render::view::RenderLayers,
utils::HashMap,
Expand Down Expand Up @@ -450,13 +450,13 @@ pub fn draw_light_gizmo(
// circle at the end of the light range at both angles
gizmos.circle(
transform.translation + range,
Direction3d::new_unchecked(transform.back().normalize()),
Dir3::new_unchecked(transform.back().normalize()),
outer_rad,
spot.color.with_alpha(1.0),
);
gizmos.circle(
transform.translation + range,
Direction3d::new_unchecked(transform.back().normalize()),
Dir3::new_unchecked(transform.back().normalize()),
inner_rad,
spot.color.with_alpha(1.0),
);
Expand Down
1 change: 0 additions & 1 deletion crates/editor_ui/src/tools/gizmo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use bevy::{prelude::*, render::camera::CameraProjection};
use bevy_egui::egui::{self, Key};
use space_editor_core::prelude::*;
use space_shared::*;
use transform_gizmo_egui::mint::RowMatrix4;
use transform_gizmo_egui::{EnumSet, Gizmo, GizmoExt, GizmoMode};

use crate::EditorGizmo;
Expand Down
8 changes: 4 additions & 4 deletions crates/prefab/src/component/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct MaterialPrefab {
impl Default for MaterialPrefab {
fn default() -> Self {
Self {
base_color: Color::rgb(1.0, 1.0, 1.0),
base_color: Color::linear_rgb(1.0, 1.0, 1.0),
base_color_texture: String::default(),
emissive: Color::BLACK,
emissive_texture: String::default(),
Expand Down Expand Up @@ -110,7 +110,7 @@ pub struct ColorMaterialPrefab {
impl Default for ColorMaterialPrefab {
fn default() -> Self {
Self {
color: Color::rgb(1.0, 1.0, 1.0),
color: Color::linear_rgb(1.0, 1.0, 1.0),
texture: String::default(),
}
}
Expand Down Expand Up @@ -201,7 +201,7 @@ mod tests {
let color = prefab.to_material(server);

assert!(color.texture.is_some());
assert_eq!(color.color, Color::rgb(1.0, 1.0, 1.0));
assert_eq!(color.color, Color::linear_rgb(1.0, 1.0, 1.0));
}

#[test]
Expand Down Expand Up @@ -242,7 +242,7 @@ mod tests {
|server: Res<AssetServer>, query: Query<&MaterialPrefab>| {
let material = query.single();
let material = material.to_material(&server);
assert_eq!(material.base_color, Color::rgb(1.0, 1.0, 1.0));
assert_eq!(material.base_color, Color::linear_rgb(1.0, 1.0, 1.0));
assert_eq!(material.emissive, Color::BLACK.into());
assert_eq!(material.emissive_texture, None);
assert_eq!(material.alpha_mode, AlphaMode::Opaque);
Expand Down
1 change: 0 additions & 1 deletion crates/shared/src/asset_fs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use anyhow::Result;
use bevy::prelude::*;
use image::DynamicImage;

use crate::gizmos::{
CAMERA_GIZMO, DIRECTION_LIGHT_GIZMO, POINT_LIGHT_GIZMO, SPOT_LIGHT_GIZMO, UNKNOWN,
Expand Down

0 comments on commit 9154aa0

Please sign in to comment.