mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-25 14:08:34 +01:00
Compare commits
2 commits
96f0c51757
...
cd32372994
Author | SHA1 | Date | |
---|---|---|---|
cd32372994 | |||
0f4e67f20f |
2 changed files with 4 additions and 3 deletions
|
@ -53,6 +53,7 @@ Improvements
|
|||
Fixes
|
||||
- Fixed paragraph links having incorrect hover locations when using special text alignments
|
||||
- Fixed the graphics device's viewport being ignored for mouse and touch queries
|
||||
- Fixed auto-navigating panels not scrolling to the center of elements properly
|
||||
|
||||
Removals
|
||||
- Marked StyleProp equality members as obsolete
|
||||
|
|
|
@ -79,13 +79,13 @@ namespace MLEM.Ui.Elements {
|
|||
};
|
||||
|
||||
// handle automatic element selection, the scroller needs to scroll to the right location
|
||||
this.OnSelectedElementChanged += (element, otherElement) => {
|
||||
this.OnSelectedElementChanged += (_, e) => {
|
||||
if (!this.Controls.IsAutoNavMode)
|
||||
return;
|
||||
if (otherElement == null || !otherElement.GetParentTree().Contains(this))
|
||||
if (e == null || !e.GetParentTree().Contains(this))
|
||||
return;
|
||||
var firstChild = this.Children.First(c => c != this.ScrollBar);
|
||||
this.ScrollBar.CurrentValue = (otherElement.Area.Bottom - firstChild.Area.Top - this.Area.Height / 2) / this.Scale;
|
||||
this.ScrollBar.CurrentValue = (e.Area.Center.Y - this.Area.Height / 2 - firstChild.Area.Top) / e.Scale + this.ChildPadding.Value.Height / 2;
|
||||
};
|
||||
this.AddChild(this.ScrollBar);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue