1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-25 22:18:34 +01:00

Compare commits

...

4 commits

4 changed files with 16 additions and 9 deletions

View file

@ -10,6 +10,7 @@ Jump to version:
- [5.0.0](#500) - [5.0.0](#500)
## 6.1.0 ## 6.1.0
### MLEM ### MLEM
Improvements Improvements
- Improved EnumHelper.GetValues signature to return an array - Improved EnumHelper.GetValues signature to return an array
@ -22,6 +23,11 @@ Improvements
- Allow elements to auto-adjust their size even when their children are aligned oddly - Allow elements to auto-adjust their size even when their children are aligned oddly
- Close other dropdowns when opening a dropdown - Close other dropdowns when opening a dropdown
Fixes
- Fixed parents of elements that prevent spill not being notified properly
- Fixed paragraphs sometimes not updating their position properly when hidden because they're empty
- Fixed panels sometimes not drawing children that came into view when their positions changed unexpectedly
### MLEM.Data ### MLEM.Data
Improvements Improvements
- Allow data texture atlas pivots and offsets to be negative - Allow data texture atlas pivots and offsets to be negative
@ -31,6 +37,7 @@ Fixes
- Fixed data texture atlases not allowing most characters in their region names - Fixed data texture atlases not allowing most characters in their region names
## 6.0.0 ## 6.0.0
### MLEM ### MLEM
Additions Additions
- Added consuming variants of IsPressed methods to InputHandler and Keybind - Added consuming variants of IsPressed methods to InputHandler and Keybind
@ -117,6 +124,7 @@ Improvements
- Updated to MonoGame 3.8.1 - Updated to MonoGame 3.8.1
## 5.3.0 ## 5.3.0
### MLEM ### MLEM
Additions Additions
- Added StringBuilder overloads to GenericFont - Added StringBuilder overloads to GenericFont
@ -201,6 +209,7 @@ Removals
- Marked CopyExtensions as obsolete - Marked CopyExtensions as obsolete
## 5.2.0 ## 5.2.0
### MLEM ### MLEM
Additions Additions
- Added a strikethrough formatting code - Added a strikethrough formatting code
@ -275,6 +284,7 @@ Additions
- Added PreDraw and PreUpdate events and coroutine events - Added PreDraw and PreUpdate events and coroutine events
## 5.1.0 ## 5.1.0
### MLEM ### MLEM
Additions Additions
- Added RotateBy to Direction2Helper - Added RotateBy to Direction2Helper
@ -325,6 +335,7 @@ Fixes
- Fixed DynamicEnum AddFlag going into an infinite loop - Fixed DynamicEnum AddFlag going into an infinite loop
## 5.0.0 ## 5.0.0
### MLEM ### MLEM
Additions Additions
- Added some Collection extensions, namely for dealing with combinations - Added some Collection extensions, namely for dealing with combinations

View file

@ -1125,7 +1125,7 @@ namespace MLEM.Ui.Elements {
/// <param name="grandchild">Whether the <paramref name="child"/> is a grandchild of this element, rather than a direct child.</param> /// <param name="grandchild">Whether the <paramref name="child"/> is a grandchild of this element, rather than a direct child.</param>
protected virtual void OnChildAreaDirty(Element child, bool grandchild) { protected virtual void OnChildAreaDirty(Element child, bool grandchild) {
if (!grandchild) { if (!grandchild) {
if (child.Anchor.IsAuto() || this.SetWidthBasedOnChildren || this.SetHeightBasedOnChildren) if (child.Anchor.IsAuto() || child.PreventParentSpill || this.SetWidthBasedOnChildren || this.SetHeightBasedOnChildren)
this.SetAreaDirty(); this.SetAreaDirty();
} }
this.Parent?.OnChildAreaDirty(child, true); this.Parent?.OnChildAreaDirty(child, true);

View file

@ -118,14 +118,10 @@ namespace MLEM.Ui.Elements {
private void ScrollChildren() { private void ScrollChildren() {
if (!this.scrollOverflow) if (!this.scrollOverflow)
return; return;
var offset = new Vector2(0, -this.ScrollBar.CurrentValue);
// we ignore false grandchildren so that the children of the scroll bar stay in place // we ignore false grandchildren so that the children of the scroll bar stay in place
foreach (var child in this.GetChildren(c => c != this.ScrollBar, true, true)) { foreach (var child in this.GetChildren(c => c != this.ScrollBar, true, true))
if (!child.ScrollOffset.Equals(offset, Element.Epsilon)) { child.ScrollOffset.Y = -this.ScrollBar.CurrentValue;
child.ScrollOffset = offset; this.relevantChildrenDirty = true;
this.relevantChildrenDirty = true;
}
}
} }
/// <inheritdoc /> /// <inheritdoc />

View file

@ -110,7 +110,7 @@ namespace MLEM.Ui.Elements {
private string text; private string text;
private StyleProp<TextAlignment> alignment; private StyleProp<TextAlignment> alignment;
private StyleProp<GenericFont> regularFont; private StyleProp<GenericFont> regularFont;
private bool forceHide; private bool forceHide = true;
/// <summary> /// <summary>
/// Creates a new paragraph with the given settings. /// Creates a new paragraph with the given settings.