1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-05-28 19:13:38 +02:00

fixed selected element looking bad with smooth scrolling

This commit is contained in:
Ellpeck 2020-03-16 15:44:53 +01:00
parent 9df1b05bee
commit e96b155f99
2 changed files with 2 additions and 2 deletions

View file

@ -471,6 +471,8 @@ namespace MLEM.Ui.Elements {
public virtual void Draw(GameTime time, SpriteBatch batch, float alpha, BlendState blendState, SamplerState samplerState, Matrix matrix) {
this.System.OnElementDrawn?.Invoke(this, time, batch, alpha);
if (this.Root.SelectedElement == this)
this.System.OnSelectedElementDrawn?.Invoke(this, time, batch, alpha);
foreach (var child in this.GetRelevantChildren()) {
if (!child.IsHidden)

View file

@ -121,8 +121,6 @@ namespace MLEM.Ui {
batch.Begin(SpriteSortMode.Deferred, this.BlendState, this.SamplerState, null, null, null, root.Transform);
var alpha = this.DrawAlpha * root.Element.DrawAlpha;
root.Element.Draw(time, batch, alpha, this.BlendState, this.SamplerState, root.Transform);
if (root.SelectedElement != null)
this.OnSelectedElementDrawn?.Invoke(root.SelectedElement, time, batch, alpha);
batch.End();
}
}