mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:33:30 +08:00
Merge pull request #27533 from bdach/fix-flashlight-gaps
Fix 1px flashlight gaps when gameplay scaling mode is active
This commit is contained in:
commit
5d40fdca86
@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
|
||||
PassCondition = () =>
|
||||
{
|
||||
var flashlightOverlay = Player.DrawableRuleset.Overlays
|
||||
.OfType<ModFlashlight<OsuHitObject>.Flashlight>()
|
||||
.ChildrenOfType<ModFlashlight<OsuHitObject>.Flashlight>()
|
||||
.First();
|
||||
|
||||
return Precision.AlmostEquals(mod.DefaultFlashlightSize * .5f, flashlightOverlay.GetSize());
|
||||
|
@ -7,6 +7,7 @@ using System.Runtime.InteropServices;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Rendering;
|
||||
using osu.Framework.Graphics.Rendering.Vertices;
|
||||
@ -88,7 +89,13 @@ namespace osu.Game.Rulesets.Mods
|
||||
flashlight.Combo.BindTo(Combo);
|
||||
flashlight.GetPlayfieldScale = () => drawableRuleset.Playfield.Scale;
|
||||
|
||||
drawableRuleset.Overlays.Add(flashlight);
|
||||
drawableRuleset.Overlays.Add(new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
// workaround for 1px gaps on the edges of the playfield which would sometimes show with "gameplay" screen scaling active.
|
||||
Padding = new MarginPadding(-1),
|
||||
Child = flashlight,
|
||||
});
|
||||
}
|
||||
|
||||
protected abstract Flashlight CreateFlashlight();
|
||||
|
Loading…
Reference in New Issue
Block a user