mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 23:57:18 +09:00
Fix column dim state changing when scrolling past extent
This commit is contained in:
parent
13a36f2e51
commit
e9c9c764ca
@ -324,15 +324,22 @@ namespace osu.Game.Overlays.Mods
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
|
// the bounds below represent the horizontal range of scroll items to be considered fully visible/active, in the scroll's internal coordinate space.
|
||||||
|
// note that clamping is applied to the left scroll bound to ensure scrolling past extents does not change the set of active columns.
|
||||||
|
float leftScrollBound = Math.Clamp(columnScroll.Current, 0, columnScroll.ScrollableExtent);
|
||||||
|
float rightScrollBound = leftScrollBound + columnScroll.DrawWidth;
|
||||||
|
|
||||||
foreach (var column in columnFlow)
|
foreach (var column in columnFlow)
|
||||||
{
|
{
|
||||||
// DrawWidth/DrawPosition do not include shear effects, and we want to know the full extents of the columns post-shear,
|
// DrawWidth/DrawPosition do not include shear effects, and we want to know the full extents of the columns post-shear,
|
||||||
// so we have to manually compensate.
|
// so we have to manually compensate.
|
||||||
var topLeft = column.ToSpaceOfOtherDrawable(new Vector2(-column.DrawHeight * SHEAR, 0), columnScroll);
|
// additionally note that columnFlow.Parent is not columnScroll, but rather it is the scroll's internal container.
|
||||||
var topRight = column.ToSpaceOfOtherDrawable(new Vector2(column.DrawWidth, 0), columnScroll);
|
// this is intentional in order to include margin of the columnFlow in calculations correctly and operate in the "scroll internal content space".
|
||||||
|
var topLeft = column.ToSpaceOfOtherDrawable(new Vector2(-column.DrawHeight * SHEAR, 0), columnFlow.Parent);
|
||||||
|
var topRight = column.ToSpaceOfOtherDrawable(new Vector2(column.DrawWidth, 0), columnFlow.Parent);
|
||||||
|
|
||||||
column.Active.Value = Precision.AlmostBigger(topLeft.X, 0)
|
column.Active.Value = Precision.AlmostBigger(topLeft.X, leftScrollBound)
|
||||||
&& Precision.DefinitelyBigger(columnScroll.DrawWidth, topRight.X);
|
&& Precision.DefinitelyBigger(rightScrollBound, topRight.X);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user