1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-26 06:28:35 +01:00

made panels update their draw area properly in drawearly

This commit is contained in:
Ellpeck 2019-12-12 22:56:49 +01:00
parent 1e62513e25
commit b8e73717f4

View file

@ -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);