mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 14:47:18 +08:00
Use better way of calculating whether columns are fully on screen
This commit is contained in:
parent
e384e074fb
commit
e13d0d02ae
@ -396,13 +396,13 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
float leftX = DrawPosition.X;
|
// DrawWidth/DrawPosition do not include shear effects, and we want to know the full extents of the columns post-shear,
|
||||||
// DrawWidth does 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.
|
||||||
float rightX = DrawPosition.X + DrawWidth + DrawHeight * SHEAR;
|
var topLeft = ToSpaceOfOtherDrawable(new Vector2(-DrawHeight * SHEAR, 0), parentScroll);
|
||||||
|
var topRight = ToSpaceOfOtherDrawable(new Vector2(DrawWidth, 0), parentScroll);
|
||||||
|
|
||||||
isFullyOnScreen.Value = Precision.AlmostBigger(leftX, parentScroll.Current)
|
isFullyOnScreen.Value = Precision.AlmostBigger(topLeft.X, 0)
|
||||||
&& Precision.DefinitelyBigger(parentScroll.Current + parentScroll.DrawWidth, rightX);
|
&& Precision.DefinitelyBigger(parentScroll.DrawWidth, topRight.X);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(MouseDownEvent e)
|
protected override bool OnMouseDown(MouseDownEvent e)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user