Content Patcher

Content Patcher

378k Downloads

[Lookup Anything] crash on some smaller resolutions

Pathoschild opened this issue · 3 comments

commented

If the screen resolution is smaller than expected (≈≤1280×768), the lookup UI crashes with the following error:

[ERROR] An error occured in the overridden draw loop: System.ArgumentException: The scissor rectangle is invalid. The scissor rectangle cannot be larger than or outside of the current render target bounds.
Parameter name: value
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice.set_ScissorRectangle(Rectangle value)
   at Pathoschild.LookupAnything.Components.LookupMenu.draw(SpriteBatch spriteBatch)
   at StardewModdingAPI.Inheritance.SGame.Draw(GameTime gameTime)
[03:42:31.174 PM] [ERROR] An error occured in the overridden draw loop: System.InvalidOperationException: Begin cannot be called again until End has been successfully called.
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix)
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState)
   at StardewModdingAPI.Inheritance.SGame.Draw(GameTime gameTime)

Reported in the forums (see 2016-10-06 #1 and 2016-10-06 #2).

commented

I can't reproduce this, so it's hard to test. Possibly fixed via b32059a.

commented

I haven't heard anything back from those who reported it, so I assume this is fixed.

commented

Fixed in the upcoming Lookup Anything 1.23.

The issue is rare, but one player was able to reproduce it and run some tests for me. It happens when the game's viewport size (Game1.viewport) is larger than the graphics device's viewport (Game1.graphics.GraphicsDevice.Viewport), which caused UI calculations to incorrectly place the menu partly outside the device viewport. The game itself is affected too, but it rarely causes noticeable errors.