1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:28:00 +08:00

Fix positioning

This commit is contained in:
smoogipoo 2018-06-07 18:59:52 +09:00
parent cd532cde2d
commit f299ae0fbd
3 changed files with 40 additions and 1 deletions

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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;
}
}
}