clamp catch values to playfield
This commit is contained in:
@@ -5,7 +5,7 @@ use rosu_map::section::hit_objects::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
catch::{attributes::CatchDifficultyAttributesBuilder, convert::CatchBeatmap},
|
||||
catch::{attributes::CatchDifficultyAttributesBuilder, convert::CatchBeatmap, PLAYFIELD_WIDTH},
|
||||
model::{
|
||||
control_point::{DifficultyPoint, TimingPoint},
|
||||
hit_object::Slider,
|
||||
@@ -120,7 +120,7 @@ impl<'a> JuiceStream<'a> {
|
||||
};
|
||||
|
||||
let nested = NestedJuiceStreamObject {
|
||||
pos: x + path.position_at(e.path_progress).x,
|
||||
pos: Self::clamp_to_playfield(x + path.position_at(e.path_progress).x),
|
||||
start_time: e.time,
|
||||
kind,
|
||||
};
|
||||
@@ -133,6 +133,10 @@ impl<'a> JuiceStream<'a> {
|
||||
nested_objects: bufs.nested_objects.drain(..),
|
||||
}
|
||||
}
|
||||
|
||||
fn clamp_to_playfield(value: f32) -> f32 {
|
||||
value.clamp(0.0, PLAYFIELD_WIDTH)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct NestedJuiceStreamObject {
|
||||
|
||||
Reference in New Issue
Block a user