diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index a9e12f5..1fb08c3 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -135,14 +135,15 @@ namespace MLEM.Ui.Elements { // if we handle overflow, draw using the render target in DrawUnbound if (!this.scrollOverflow) { base.Draw(time, batch, alpha, blendState, samplerState, matrix); - } else if (this.renderTarget != null) { + } else { // 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); } } public override void DrawEarly(GameTime time, SpriteBatch batch, float alpha, BlendState blendState, SamplerState samplerState, Matrix matrix) { - if (this.scrollOverflow && this.renderTarget != null) { + if (this.scrollOverflow) { + this.UpdateAreaIfDirty(); // draw children onto the render target batch.GraphicsDevice.SetRenderTarget(this.renderTarget); batch.GraphicsDevice.Clear(Color.Transparent);