1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-24 13:38:34 +01:00

Compare commits

..

No commits in common. "20e2d098ef19151a3796c59a2c9bc03d0e228791" and "d1fbcb95599f6b1de1263ec2a03521e7011d952f" have entirely different histories.

View file

@ -15,7 +15,7 @@ namespace MLEM.Ui.Elements {
/// Additionally, a panel can be set to <see cref="scrollOverflow"/> on construction, which causes all elements that don't fit into the panel to be hidden until scrolled to using a <see cref="ScrollBar"/>.
/// As this behavior is accomplished using a <see cref="RenderTarget2D"/>, scrolling panels need to have their <see cref="DrawEarly"/> methods called using <see cref="UiSystem.DrawEarly"/>.
/// </summary>
public class Panel : Element, IDisposable {
public class Panel : Element {
/// <summary>
/// The texture that this panel should have, or null if it should be invisible.
@ -76,10 +76,6 @@ namespace MLEM.Ui.Elements {
}
}
~Panel() {
this.Dispose();
}
/// <inheritdoc />
public override void ForceUpdateArea() {
if (this.scrollOverflow) {
@ -182,10 +178,13 @@ namespace MLEM.Ui.Elements {
batch.Begin(SpriteSortMode.Deferred, blendState, samplerState, null, null, null, trans);
base.Draw(time, batch, alpha, blendState, samplerState, trans);
batch.End();
// also draw any children early within the render target with the translation applied
base.DrawEarly(time, batch, alpha, blendState, samplerState, trans);
}
}
} else {
base.DrawEarly(time, batch, alpha, blendState, samplerState, matrix);
}
}
/// <inheritdoc />
public override Element GetElementUnderPos(Vector2 position) {
@ -235,14 +234,5 @@ namespace MLEM.Ui.Elements {
}
}
/// <inheritdoc />
public void Dispose() {
if (this.renderTarget != null) {
this.renderTarget.Dispose();
this.renderTarget = null;
}
GC.SuppressFinalize(this);
}
}
}