Skip to content

Commit

Permalink
update TouchPanel only when _clientBounds changed
Browse files Browse the repository at this point in the history
  • Loading branch information
nkast committed May 21, 2024
1 parent c931355 commit 72a6672
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions MonoGame.Framework/Platform/Android/AndroidGameWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions MonoGame.Framework/Platform/Cardboard/AndroidGameWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 72a6672

Please sign in to comment.