@@ -265,7 +265,7 @@ public override void Draw(SpriteBatch spriteBatch)
265265 OnEnterPress ? . Invoke ( this , new EventArgs ( ) ) ;
266266 }
267267 spriteBatch . End ( ) ;
268- spriteBatch . Begin ( SpriteSortMode . Immediate , BlendState . AlphaBlend ) ;
268+ spriteBatch . Begin ( SpriteSortMode . Immediate , BlendState . AlphaBlend , null , null , null , null , Main . UIScaleMatrix ) ;
269269 Main . instance . DrawWindowsIMEPanel ( new Vector2 ( 98f , ( float ) ( Main . screenHeight - 36 ) ) , 0f ) ;
270270 }
271271
@@ -286,10 +286,10 @@ public override void Draw(SpriteBatch spriteBatch)
286286 if ( pos . X <= Main . screenWidth && pos . Y <= Main . screenHeight && pos . X + Width >= 0 && pos . Y + Height >= 0 )
287287 {
288288 spriteBatch . End ( ) ;
289- spriteBatch . Begin ( SpriteSortMode . Immediate , BlendState . AlphaBlend , null , null , _rasterizerState ) ;
289+ spriteBatch . Begin ( SpriteSortMode . Immediate , BlendState . AlphaBlend , null , null , _rasterizerState , null , Main . UIScaleMatrix ) ;
290290
291291 Rectangle cutRect = new Rectangle ( ( int ) pos . X , ( int ) pos . Y , ( int ) Width , ( int ) Height ) ;
292- if ( cutRect . X < 0 )
292+ /* if (cutRect.X < 0)
293293 {
294294 cutRect.Width += cutRect.X;
295295 cutRect.X = 0;
@@ -300,7 +300,8 @@ public override void Draw(SpriteBatch spriteBatch)
300300 cutRect.Y = 0;
301301 }
302302 if (cutRect.X + Width > Main.screenWidth) cutRect.Width = Main.screenWidth - cutRect.X;
303- if ( cutRect . Y + Height > Main . screenHeight ) cutRect . Height = Main . screenHeight - cutRect . Y ;
303+ if (cutRect.Y + Height > Main.screenHeight) cutRect.Height = Main.screenHeight - cutRect.Y;*/
304+ cutRect = ModUtils . GetClippingRectangle ( spriteBatch , cutRect ) ;
304305
305306 Rectangle currentRect = spriteBatch . GraphicsDevice . ScissorRectangle ;
306307 spriteBatch . GraphicsDevice . ScissorRectangle = cutRect ;
@@ -309,7 +310,7 @@ public override void Draw(SpriteBatch spriteBatch)
309310
310311 spriteBatch . GraphicsDevice . ScissorRectangle = currentRect ;
311312 spriteBatch . End ( ) ;
312- spriteBatch . Begin ( SpriteSortMode . Immediate , BlendState . NonPremultiplied ) ;
313+ spriteBatch . Begin ( SpriteSortMode . Immediate , BlendState . NonPremultiplied , null , null , null , null , Main . UIScaleMatrix ) ;
313314 }
314315 }
315316 }
0 commit comments