Skip to content

Commit fd3f7d8

Browse files
committed
lock map to center camera if the display resolution exceeds map size for Seamed GameBorderStyle
1 parent ffffe34 commit fd3f7d8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Intersect.Client.Core/Core/Graphics.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Intersect.Client.Maps;
99
using Intersect.Configuration;
1010
using Intersect.Enums;
11+
using Intersect.Framework.Core.GameObjects.Maps;
1112
using Intersect.GameObjects;
1213
using Intersect.Utilities;
1314

@@ -1000,6 +1001,10 @@ private static void UpdateView()
10001001
newView.X = restrictView.Right - newView.Width;
10011002
}
10021003
}
1004+
else if (Options.Instance.Map.GameBorderStyle == GameBorderStyle.Seamed)
1005+
{
1006+
newView.X = restrictView.X - (newView.Width - restrictView.Width) / 2;
1007+
}
10031008

10041009
if (restrictView.Height >= newView.Height)
10051010
{
@@ -1013,6 +1018,10 @@ private static void UpdateView()
10131018
newView.Y = restrictView.Bottom - newView.Height;
10141019
}
10151020
}
1021+
else if (Options.Instance.Map.GameBorderStyle == GameBorderStyle.Seamed)
1022+
{
1023+
newView.Y = restrictView.Y - (newView.Height - restrictView.Height) / 2;
1024+
}
10161025

10171026
CurrentView = new FloatRect(
10181027
newView.X,

0 commit comments

Comments
 (0)