1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 04:53:29 +01:00

fixed FNA

This commit is contained in:
Ell 2023-08-14 17:52:16 +02:00
parent 237334b1c9
commit 4d7d628486

View file

@ -289,15 +289,15 @@ namespace MLEM.Ui.Elements {
this.ScrollBar.ScrollerSize = new Vector2(this.ScrollerSize.Value.X, Math.Max(this.ScrollerSize.Value.Y, scrollerHeight));
// update the render target
var (_, _, width, height) = (Rectangle) this.GetRenderTargetArea();
if (width <= 0 || height <= 0) {
var area = (Rectangle) this.GetRenderTargetArea();
if (area.Width <= 0 || area.Height <= 0) {
this.renderTarget?.Dispose();
this.renderTarget = null;
return;
}
if (this.renderTarget == null || width != this.renderTarget.Width || height != this.renderTarget.Height) {
if (this.renderTarget == null || area.Width != this.renderTarget.Width || area.Height != this.renderTarget.Height) {
this.renderTarget?.Dispose();
this.renderTarget = new RenderTarget2D(this.System.Game.GraphicsDevice, width, height, false, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.PreserveContents);
this.renderTarget = new RenderTarget2D(this.System.Game.GraphicsDevice, area.Width, area.Height, false, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.PreserveContents);
this.relevantChildrenDirty = true;
}
}