1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +01:00

sanity check for panel render target size

This commit is contained in:
Ellpeck 2020-06-01 21:34:55 +02:00
parent 62c8b7766c
commit c7de0322b0

View file

@ -213,6 +213,8 @@ namespace MLEM.Ui.Elements {
// update the render target
var targetArea = (Rectangle) this.GetRenderTargetArea();
if (targetArea.Width <= 0 || targetArea.Height <= 0)
return;
if (this.renderTarget == null || targetArea.Width != this.renderTarget.Width || targetArea.Height != this.renderTarget.Height) {
if (this.renderTarget != null)
this.renderTarget.Dispose();