mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 20:47:51 +08:00
Use more lenient column bounds for checking active state
This commit is contained in:
parent
21377d2a4d
commit
921e8af3b0
@ -345,13 +345,13 @@ namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
// 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.
|
||||
var topLeft = column.ToSpaceOfOtherDrawable(new Vector2(-column.DrawHeight * SHEAR, 0), ScrollContent);
|
||||
var topRight = column.ToSpaceOfOtherDrawable(new Vector2(column.DrawWidth, 0), ScrollContent);
|
||||
var topLeft = column.ToSpaceOfOtherDrawable(Vector2.Zero, ScrollContent);
|
||||
var bottomRight = column.ToSpaceOfOtherDrawable(new Vector2(column.DrawWidth - column.DrawHeight * SHEAR, 0), ScrollContent);
|
||||
|
||||
bool isCurrentlyVisible = Precision.AlmostBigger(topLeft.X, leftVisibleBound)
|
||||
&& Precision.DefinitelyBigger(rightVisibleBound, topRight.X);
|
||||
&& Precision.DefinitelyBigger(rightVisibleBound, bottomRight.X);
|
||||
bool isBeingScrolledToward = Precision.AlmostBigger(topLeft.X, leftMovementBound)
|
||||
&& Precision.DefinitelyBigger(rightMovementBound, topRight.X);
|
||||
&& Precision.DefinitelyBigger(rightMovementBound, bottomRight.X);
|
||||
|
||||
column.Active.Value = isCurrentlyVisible || isBeingScrolledToward;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user