mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
fixed the panel updating its render target too often
This commit is contained in:
parent
f28e234392
commit
f1c9ba5517
1 changed files with 2 additions and 2 deletions
|
@ -79,11 +79,11 @@ namespace MLEM.Ui.Elements {
|
|||
this.ScrollBar.MaxValue = (childrenHeight - this.Area.Height) / this.Scale + this.ChildPadding.Y * 2;
|
||||
|
||||
// update the render target
|
||||
var targetArea = this.GetRenderTargetArea();
|
||||
var targetArea = (Rectangle) this.GetRenderTargetArea();
|
||||
if (this.renderTarget == null || targetArea.Width != this.renderTarget.Width || targetArea.Height != this.renderTarget.Height) {
|
||||
if (this.renderTarget != null)
|
||||
this.renderTarget.Dispose();
|
||||
this.renderTarget = targetArea.IsEmpty ? null : new RenderTarget2D(this.System.GraphicsDevice, targetArea.Width.Ceil(), targetArea.Height.Ceil());
|
||||
this.renderTarget = targetArea.IsEmpty ? null : new RenderTarget2D(this.System.GraphicsDevice, targetArea.Width, targetArea.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue