From b8e73717f43679ae5d5414d3cc334251605dab38 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 12 Dec 2019 22:56:49 +0100 Subject: [PATCH] made panels update their draw area properly in drawearly --- MLEM.Ui/Elements/Panel.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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);