fix: clamp effective x
This commit is contained in:
@@ -97,8 +97,9 @@ fn convert_object<'a>(
|
|||||||
let state = match h.kind {
|
let state = match h.kind {
|
||||||
HitObjectKind::Circle => ObjectIterState::Fruit(Some(Fruit::new(count))),
|
HitObjectKind::Circle => ObjectIterState::Fruit(Some(Fruit::new(count))),
|
||||||
HitObjectKind::Slider(ref slider) => {
|
HitObjectKind::Slider(ref slider) => {
|
||||||
let x = h.pos.x;
|
let effective_x = h.pos.x.clamp(0.0, PLAYFIELD_WIDTH);
|
||||||
let stream = JuiceStream::new(x, h.start_time, slider, converted, count, bufs);
|
let stream =
|
||||||
|
JuiceStream::new(effective_x, h.start_time, slider, converted, count, bufs);
|
||||||
|
|
||||||
ObjectIterState::JuiceStream(stream)
|
ObjectIterState::JuiceStream(stream)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ impl<'a> JuiceStream<'a> {
|
|||||||
pub const BASE_SCORING_DIST: f64 = 100.0;
|
pub const BASE_SCORING_DIST: f64 = 100.0;
|
||||||
|
|
||||||
pub fn new(
|
pub fn new(
|
||||||
x: f32,
|
effective_x: f32,
|
||||||
start_time: f64,
|
start_time: f64,
|
||||||
slider: &'a Slider,
|
slider: &'a Slider,
|
||||||
converted: &CatchBeatmap<'_>,
|
converted: &CatchBeatmap<'_>,
|
||||||
@@ -122,7 +122,7 @@ impl<'a> JuiceStream<'a> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let nested = NestedJuiceStreamObject {
|
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,
|
start_time: e.time,
|
||||||
kind,
|
kind,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user