From 44d0dc6113a408a15a18025325e55646a2147b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 8 Mar 2024 11:05:07 +0100 Subject: [PATCH] Fix 1px flashlight gaps when gameplay scaling mode is active Closes https://github.com/ppy/osu/issues/27522. Concerns mostly taiko and catch. Not much of a proper fix rather than a workaround but it is what it is. I tried a few other things, including setting `MaskingSmoothness = 0` on the scaling container itself, to no avail. --- osu.Game/Rulesets/Mods/ModFlashlight.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModFlashlight.cs b/osu.Game/Rulesets/Mods/ModFlashlight.cs index c3775b0875..c924915bd0 100644 --- a/osu.Game/Rulesets/Mods/ModFlashlight.cs +++ b/osu.Game/Rulesets/Mods/ModFlashlight.cs @@ -7,6 +7,7 @@ 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 @@ public virtual void ApplyToDrawableRuleset(DrawableRuleset drawableRuleset) 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();