1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-23 02:31:18 +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:
Dean Herbert
2024-03-08 22:55:18 +08:00
committed by GitHub
Unverified
2 changed files with 9 additions and 2 deletions
@@ -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());
+8 -1
View File
@@ -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();