fix: refactor get_precision_adjusted_beat_len
This commit is contained in:
@@ -11,6 +11,7 @@ use crate::{
|
||||
control_point::{DifficultyPoint, TimingPoint},
|
||||
hit_object::Slider,
|
||||
},
|
||||
util::get_precision_adjusted_beat_len,
|
||||
};
|
||||
|
||||
pub struct JuiceStream<'a> {
|
||||
@@ -159,15 +160,3 @@ pub struct JuiceStreamBufs {
|
||||
pub curve: CurveBuffers,
|
||||
pub ticks: Vec<SliderEvent>,
|
||||
}
|
||||
|
||||
fn get_precision_adjusted_beat_len(slider_velocity_multiplier: f64, beat_len: f64) -> f64 {
|
||||
let slider_velocity_as_beat_len = -100.0 / slider_velocity_multiplier;
|
||||
|
||||
let bpm_multiplier = if slider_velocity_as_beat_len < 0.0 {
|
||||
f64::from(((-slider_velocity_as_beat_len) as f32).clamp(10.0, 10_000.0)) / 100.0
|
||||
} else {
|
||||
1.0
|
||||
};
|
||||
|
||||
beat_len * bpm_multiplier
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user