fix: clamp effective x

This commit is contained in:
MaxOhn
2024-11-08 22:04:37 +01:00
parent 9e4db4096e
commit 0448980cd5
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -97,8 +97,9 @@ fn convert_object<'a>(
let state = match h.kind {
HitObjectKind::Circle => ObjectIterState::Fruit(Some(Fruit::new(count))),
HitObjectKind::Slider(ref slider) => {
let x = h.pos.x;
let stream = JuiceStream::new(x, h.start_time, slider, converted, count, bufs);
let effective_x = h.pos.x.clamp(0.0, PLAYFIELD_WIDTH);
let stream =
JuiceStream::new(effective_x, h.start_time, slider, converted, count, bufs);
ObjectIterState::JuiceStream(stream)
}
+2 -2
View File
@@ -23,7 +23,7 @@ impl<'a> JuiceStream<'a> {
pub const BASE_SCORING_DIST: f64 = 100.0;
pub fn new(
x: f32,
effective_x: f32,
start_time: f64,
slider: &'a Slider,
converted: &CatchBeatmap<'_>,
@@ -122,7 +122,7 @@ impl<'a> JuiceStream<'a> {
};
let nested = NestedJuiceStreamObject {
pos: x + path.position_at(e.path_progress).x,
pos: effective_x + path.position_at(e.path_progress).x,
start_time: e.time,
kind,
};