Skip to content

Commit

Permalink
style: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
carrascomj committed Mar 13, 2024
1 parent 2352a5d commit b1c6c79
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ fn load_data(
to_remove: Query<Entity, Or<(With<aesthetics::Aesthetics>, With<HistTag>, With<Xaxis>)>>,
) {
let custom_asset = if let Some(reac_handle) = &state.reaction_data {
if let Some(bevy::asset::LoadState::Failed) = asset_server.get_load_state(&*reac_handle) {
if let Some(bevy::asset::LoadState::Failed) = asset_server.get_load_state(reac_handle) {
info_state
.notify("Failed loading data! Check if your metabolism.json is in correct format.");
state.reaction_data = None;
Expand Down
4 changes: 2 additions & 2 deletions src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ fn follow_mouse_on_drag_ui(
};
if let Some(screen_pos) = win.cursor_position() {
// arbitrary offset to make it feel more natural
style.left = Val::Px(screen_pos.x - 80. * ui_scale.0 as f32);
style.bottom = Val::Px(screen_pos.y - 50. * ui_scale.0 as f32);
style.left = Val::Px(screen_pos.x - 80. * ui_scale.0);
style.bottom = Val::Px(screen_pos.y - 50. * ui_scale.0);
}
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/screenshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,10 @@ fn save_svg_file(
// undo the scaling done on the whole SVG only for the legend
.push_group(
legend_nodes,
roarsvg::SvgTransform::from_scale(ui_scale.0 as f32, -ui_scale.0 as f32)
.post_translate(
legend_trans.translation().x,
legend_trans.translation().y,
),
roarsvg::SvgTransform::from_scale(ui_scale.0, -ui_scale.0).post_translate(
legend_trans.translation().x,
legend_trans.translation().y,
),
)
.unwrap();
}
Expand Down

0 comments on commit b1c6c79

Please sign in to comment.