mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Fix scrolling hit object displayed in wrong position for one frame
This commit is contained in:
@ -225,10 +225,19 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
hitObject.LifetimeStart = computeOriginAdjustedLifetimeStart(hitObject);
|
hitObject.LifetimeStart = computeOriginAdjustedLifetimeStart(hitObject);
|
||||||
|
|
||||||
toComputeLifetime.Clear();
|
toComputeLifetime.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
// only AliveObjects need to be considered for layout (reduces overhead in the case of scroll speed changes).
|
protected override void UpdateAfterChildrenLife()
|
||||||
|
{
|
||||||
|
base.UpdateAfterChildrenLife();
|
||||||
|
|
||||||
|
// We need to calculate hit object positions (including nested hit objects) as soon as possible after lifetimes
|
||||||
|
// to prevent hit objects displayed in a wrong position for one frame.
|
||||||
|
// Only AliveObjects need to be considered for layout (reduces overhead in the case of scroll speed changes).
|
||||||
foreach (var obj in AliveObjects)
|
foreach (var obj in AliveObjects)
|
||||||
{
|
{
|
||||||
|
updatePosition(obj, Time.Current);
|
||||||
|
|
||||||
if (layoutComputed.Contains(obj))
|
if (layoutComputed.Contains(obj))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -293,15 +302,6 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateAfterChildrenLife()
|
|
||||||
{
|
|
||||||
base.UpdateAfterChildrenLife();
|
|
||||||
|
|
||||||
// We need to calculate hitobject positions as soon as possible after lifetimes so that hitobjects get the final say in their positions
|
|
||||||
foreach (var obj in AliveObjects)
|
|
||||||
updatePosition(obj, Time.Current);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updatePosition(DrawableHitObject hitObject, double currentTime)
|
private void updatePosition(DrawableHitObject hitObject, double currentTime)
|
||||||
{
|
{
|
||||||
switch (direction.Value)
|
switch (direction.Value)
|
||||||
|
Reference in New Issue
Block a user