From 72a6672838dd92aa1b8ea8a7ff42539d94942902 Mon Sep 17 00:00:00 2001 From: Nikos Kastellanos Date: Tue, 21 May 2024 09:49:59 +0300 Subject: [PATCH] update TouchPanel only when _clientBounds changed --- MonoGame.Framework/Platform/Android/AndroidGameWindow.cs | 7 ++++--- .../Platform/Cardboard/AndroidGameWindow.cs | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/MonoGame.Framework/Platform/Android/AndroidGameWindow.cs b/MonoGame.Framework/Platform/Android/AndroidGameWindow.cs index 431f70ce281..8d5079198f7 100644 --- a/MonoGame.Framework/Platform/Android/AndroidGameWindow.cs +++ b/MonoGame.Framework/Platform/Android/AndroidGameWindow.cs @@ -244,11 +244,12 @@ internal void ChangeClientBounds(Rectangle bounds) { _clientBounds = bounds; OnClientSizeChanged(); + + Android.Util.Log.Debug("Kni", "GameWindow.ChangeClientBounds: newClientBounds=" + this.ClientBounds.Width + "," + this.ClientBounds.Height); + TouchPanel.DisplayWidth = this.ClientBounds.Width; + TouchPanel.DisplayHeight = this.ClientBounds.Height; } - Android.Util.Log.Debug("Kni", "GameWindow.ChangeClientBounds: newClientBounds=" + this.ClientBounds.Width + "," + this.ClientBounds.Height); - TouchPanel.DisplayWidth = this.ClientBounds.Width; - TouchPanel.DisplayHeight = this.ClientBounds.Height; } public override bool AllowUserResizing diff --git a/MonoGame.Framework/Platform/Cardboard/AndroidGameWindow.cs b/MonoGame.Framework/Platform/Cardboard/AndroidGameWindow.cs index 50a0c42267e..a284ed40e1a 100644 --- a/MonoGame.Framework/Platform/Cardboard/AndroidGameWindow.cs +++ b/MonoGame.Framework/Platform/Cardboard/AndroidGameWindow.cs @@ -244,11 +244,11 @@ internal void ChangeClientBounds(Rectangle bounds) { _clientBounds = bounds; OnClientSizeChanged(); - } - Android.Util.Log.Debug("Kni", "GameWindow.ChangeClientBounds: newClientBounds=" + this.ClientBounds.Width + "," + this.ClientBounds.Height); - TouchPanel.DisplayWidth = this.ClientBounds.Width; - TouchPanel.DisplayHeight = this.ClientBounds.Height; + Android.Util.Log.Debug("Kni", "GameWindow.ChangeClientBounds: newClientBounds=" + this.ClientBounds.Width + "," + this.ClientBounds.Height); + TouchPanel.DisplayWidth = this.ClientBounds.Width; + TouchPanel.DisplayHeight = this.ClientBounds.Height; + } } public override bool AllowUserResizing