mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-26 06:28:35 +01:00
made panels without content not crash
This commit is contained in:
parent
a53179e2d8
commit
fff25c6c12
1 changed files with 2 additions and 2 deletions
|
@ -137,14 +137,14 @@ namespace MLEM.Ui.Elements {
|
||||||
// if we handle overflow, draw using the render target in DrawUnbound
|
// if we handle overflow, draw using the render target in DrawUnbound
|
||||||
if (!this.scrollOverflow) {
|
if (!this.scrollOverflow) {
|
||||||
base.Draw(time, batch, alpha, blendState, samplerState, matrix);
|
base.Draw(time, batch, alpha, blendState, samplerState, matrix);
|
||||||
} else {
|
} else if (this.renderTarget != null) {
|
||||||
// draw the actual render target (don't apply the alpha here because it's already drawn onto with alpha)
|
// draw the actual render target (don't apply the alpha here because it's already drawn onto with alpha)
|
||||||
batch.Draw(this.renderTarget, this.GetRenderTargetArea(), Color.White);
|
batch.Draw(this.renderTarget, this.GetRenderTargetArea(), Color.White);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DrawEarly(GameTime time, SpriteBatch batch, float alpha, BlendState blendState, SamplerState samplerState, Matrix matrix) {
|
public override void DrawEarly(GameTime time, SpriteBatch batch, float alpha, BlendState blendState, SamplerState samplerState, Matrix matrix) {
|
||||||
if (this.scrollOverflow) {
|
if (this.scrollOverflow && this.renderTarget != null) {
|
||||||
this.UpdateAreaIfDirty();
|
this.UpdateAreaIfDirty();
|
||||||
// draw children onto the render target
|
// draw children onto the render target
|
||||||
batch.GraphicsDevice.SetRenderTarget(this.renderTarget);
|
batch.GraphicsDevice.SetRenderTarget(this.renderTarget);
|
||||||
|
|
Loading…
Reference in a new issue