1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-25 05:58:35 +01:00

Fixed AutoInline elements overflowing into their parent if it's taller

This commit is contained in:
Ell 2023-03-29 20:56:56 +02:00
parent 94a54c336e
commit db454ebd71
2 changed files with 6 additions and 3 deletions

View file

@ -34,10 +34,11 @@ Removals
### MLEM.Ui ### MLEM.Ui
Additions Additions
- Added `AutoInlineCenter` and `AutoInlineBottom` anchors - Added AutoInlineCenter and AutoInlineBottom anchors
Fixes Fixes
- Fixed images not updating their hidden state properly when the displayed texture changes - Fixed images not updating their hidden state properly when the displayed texture changes
- Fixed AutoInline elements overflowing into their parent if it's taller
Improvements Improvements
- Increased Element area calculation recursion limit to 64 - Increased Element area calculation recursion limit to 64

View file

@ -728,9 +728,11 @@ namespace MLEM.Ui.Elements {
pos.Y += anchorElArea.Height - newSize.Y; pos.Y += anchorElArea.Height - newSize.Y;
} }
} else { } else {
// all inline anchors act the same when overflowing into the next line
pos.X = parentArea.X + this.ScaledOffset.X; pos.X = parentArea.X + this.ScaledOffset.X;
pos.Y = anchorElArea.Bottom + this.ScaledOffset.Y; // inline anchors that overflow into the next line act like AutoLeft
var newlineAnchorEl = this.GetLowestOlderSibling(e => !e.IsHidden && e.CanAutoAnchorsAttach);
if (newlineAnchorEl != null)
pos.Y = newlineAnchorEl.GetAreaForAutoAnchors().Bottom + this.ScaledOffset.Y;
} }
} }
} else { } else {