From b20051fd55b9977152b22e1d3a86dba86d9b0839 Mon Sep 17 00:00:00 2001 From: Nitrous Date: Thu, 25 Jan 2024 10:35:41 +0800 Subject: [PATCH] offset crop rectangle to scaling container --- osu.Game/Graphics/ScreenshotManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Graphics/ScreenshotManager.cs b/osu.Game/Graphics/ScreenshotManager.cs index 47ce0d31eb..a60d55cbef 100644 --- a/osu.Game/Graphics/ScreenshotManager.cs +++ b/osu.Game/Graphics/ScreenshotManager.cs @@ -53,6 +53,8 @@ namespace osu.Game.Graphics private INotificationOverlay notificationOverlay { get; set; } private Sample shutter; + private Bindable posX; + private Bindable posY; private Bindable sizeX; private Bindable sizeY; private Bindable scalingMode; @@ -67,6 +69,8 @@ namespace osu.Game.Graphics shutter = audio.Samples.Get("UI/shutter"); + posX = config.GetBindable(OsuSetting.ScalingPositionX); + posY = config.GetBindable(OsuSetting.ScalingPositionY); sizeX = config.GetBindable(OsuSetting.ScalingSizeX); sizeY = config.GetBindable(OsuSetting.ScalingSizeY); scalingMode = config.GetBindable(OsuSetting.Scaling); @@ -136,6 +140,8 @@ namespace osu.Game.Graphics int sx = (size.Width - (int)(size.Width * sizeX.Value)) / 2; int sy = (size.Height - (int)(size.Height * sizeY.Value)) / 2; rect.Inflate(-sx, -sy); + rect.X = (int)(rect.X * posX.Value) * 2; + rect.Y = (int)(rect.Y * posY.Value) * 2; m.Crop(rect); }); }