diff --git a/Cargo.lock b/Cargo.lock index 5b110aa..80f94cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2394,7 +2394,7 @@ checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "rawaccel_convert" version = "0.1.0" -source = "git+https://github.com/Kuuuube/rawaccel_convert.git?rev=6120d1dcc079a7ffffa41b0c74fc1a062281fe55#6120d1dcc079a7ffffa41b0c74fc1a062281fe55" +source = "git+https://github.com/Kuuuube/rawaccel_convert.git?rev=f126e7c8a3361bcb93a40ec947f787563878266f#f126e7c8a3361bcb93a40ec947f787563878266f" [[package]] name = "rawaccel_convert_gui" diff --git a/Cargo.toml b/Cargo.toml index f7b38fe..c766241 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -rawaccel_convert = { git = "https://github.com/Kuuuube/rawaccel_convert.git", rev = "6120d1dcc079a7ffffa41b0c74fc1a062281fe55" } +rawaccel_convert = { git = "https://github.com/Kuuuube/rawaccel_convert.git", rev = "f126e7c8a3361bcb93a40ec947f787563878266f" } egui = "0.28.1" eframe = { version = "0.28.1", features = [ "default_fonts", "glow", "persistence" ] } env_logger = "0.11.3" diff --git a/src/gui.rs b/src/gui.rs index 636f8e6..1a0689f 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -398,7 +398,10 @@ impl eframe::App for RawaccelConvertGui { .allow_drag(false) .allow_scroll(false); plot.show(ui, |plot_ui| { - plot_ui.set_plot_bounds(egui_plot::PlotBounds::from_min_max(plot_bounds.0, plot_bounds.1)); + plot_ui.set_plot_bounds(egui_plot::PlotBounds::from_min_max( + plot_bounds.0, + plot_bounds.1, + )); plot_ui.line( egui_plot::Line::new(egui_plot::PlotPoints::new(convert_points(plot_points))) .color(egui::Color32::from_rgb(100, 100, 200)) @@ -426,16 +429,24 @@ fn get_point(x: f64, args: &AccelArgs) -> f64 { AccelMode::Jump => rawaccel_convert::accel_curves::jump::jump(x, &args), AccelMode::Natural => rawaccel_convert::accel_curves::natural::natural(x, &args), AccelMode::Synchronous => { - rawaccel_convert::accel_curves::synchronous::synchronous(x, &args).unwrap_or_default() + rawaccel_convert::accel_curves::synchronous::synchronous(x, &args) + .unwrap_or_default() } AccelMode::Power => rawaccel_convert::accel_curves::power::power(x, &args), - AccelMode::Motivity => rawaccel_convert::accel_curves::motivity::motivity(x, args).unwrap_or_default(), - AccelMode::Lookup => rawaccel_convert::accel_curves::lookup::lookup(x, args).unwrap_or_default(), + AccelMode::Motivity => { + rawaccel_convert::accel_curves::motivity::motivity(x, args).unwrap_or_default() + } + AccelMode::Lookup => { + rawaccel_convert::accel_curves::lookup::lookup(x, args).unwrap_or_default() + } AccelMode::Noaccel => rawaccel_convert::accel_curves::noaccel::noaccel(x, &args), }; match args.point_scaling { PointScaling::Sens => return y, - PointScaling::Velocity | PointScaling::Libinput | PointScaling::LibinputDebug | PointScaling::Lookup => { + PointScaling::Velocity + | PointScaling::Libinput + | PointScaling::LibinputDebug + | PointScaling::Lookup => { let converted_point = rawaccel_convert::convert_curve::sensitivity_point_to_velocity( rawaccel_convert::types::Point { x, y }, ); @@ -447,7 +458,10 @@ fn get_point(x: f64, args: &AccelArgs) -> f64 { } } -fn get_bounds(rawaccel_convert_gui: &mut RawaccelConvertGui, args: &AccelArgs) -> ([f64; 2], [f64; 2]) { +fn get_bounds( + rawaccel_convert_gui: &mut RawaccelConvertGui, + args: &AccelArgs, +) -> ([f64; 2], [f64; 2]) { match args.mode { AccelMode::Lookup => { let plot_min_x = 0.1; @@ -470,7 +484,7 @@ fn get_bounds(rawaccel_convert_gui: &mut RawaccelConvertGui, args: &AccelArgs) - [plot_min_x, plot_min_y * 0.9], [plot_max_x, plot_max_y * 1.1], ); - }, + } _ => { let plot_min_x = match args.mode { AccelMode::Power | AccelMode::Lookup => 0.1, @@ -1006,7 +1020,8 @@ fn add_lookup_table_box(rawaccel_convert_gui: &mut RawaccelConvertGui, ui: &mut ); ui.add_sized( ui.available_size(), - egui::TextEdit::singleline(&mut rawaccel_convert_gui.settings.lookup_table_string).char_limit(usize::MAX), + egui::TextEdit::singleline(&mut rawaccel_convert_gui.settings.lookup_table_string) + .char_limit(usize::MAX), ); } @@ -1192,7 +1207,10 @@ fn add_points_dump(rawaccel_convert_gui: &mut RawaccelConvertGui, ui: &mut egui: rawaccel_convert_gui.accel_args.optimize_curve = match rawaccel_convert_gui.export_point_scaling { - PointScaling::Sens | PointScaling::Velocity | PointScaling::Gain | PointScaling::Lookup => true, + PointScaling::Sens + | PointScaling::Velocity + | PointScaling::Gain + | PointScaling::Lookup => true, PointScaling::Libinput | PointScaling::LibinputDebug => false, };