mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:28:00 +08:00
Fix positioning
This commit is contained in:
parent
cd532cde2d
commit
f299ae0fbd
@ -0,0 +1,27 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Edit.Screens.Compose.Layers;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Edit.Layers
|
||||
{
|
||||
public class ManiaHitObjectMaskLayer : HitObjectMaskLayer
|
||||
{
|
||||
public readonly IBindable<bool> Inverted = new Bindable<bool>();
|
||||
|
||||
public ManiaHitObjectMaskLayer(Playfield playfield, HitObjectComposer composer)
|
||||
: base(playfield, composer)
|
||||
{
|
||||
Inverted.ValueChanged += invertedChanged;
|
||||
}
|
||||
|
||||
private void invertedChanged(bool newValue)
|
||||
{
|
||||
Scale = new Vector2(1, newValue ? -1 : 1);
|
||||
}
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||
@ -32,7 +33,7 @@ namespace osu.Game.Rulesets.Mania.Edit.Layers.Selection.Overlays
|
||||
base.Update();
|
||||
|
||||
Size = HitObject.DrawSize;
|
||||
Position = Parent.ToLocalSpace(HitObject.ScreenSpaceDrawQuad.BottomLeft);
|
||||
Position = Parent.ToLocalSpace(HitObject.ScreenSpaceDrawQuad.TopLeft);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,9 @@ using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Rulesets.Mania.Edit.Layers;
|
||||
using osu.Game.Rulesets.Mania.UI;
|
||||
using osu.Game.Screens.Edit.Screens.Compose.Layers;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Edit
|
||||
{
|
||||
@ -40,5 +43,13 @@ namespace osu.Game.Rulesets.Mania.Edit
|
||||
|
||||
return base.CreateMaskFor(hitObject);
|
||||
}
|
||||
|
||||
protected override HitObjectMaskLayer CreateHitObjectMaskLayer()
|
||||
{
|
||||
var layer = new ManiaHitObjectMaskLayer(RulesetContainer.Playfield, this);
|
||||
layer.Inverted.BindTo(((ManiaPlayfield)RulesetContainer.Playfield).Inverted);
|
||||
|
||||
return layer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user