mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 04:53:29 +01:00
Fixed a crash if a paragraph has a link formatting code, but no font
This commit is contained in:
parent
f71eb6eddb
commit
642608a8a2
2 changed files with 6 additions and 1 deletions
|
@ -13,6 +13,10 @@ Fixes
|
|||
Improvements
|
||||
- Improved NinePatch memory performance
|
||||
|
||||
### MLEM.Ui
|
||||
Fixes
|
||||
- Fixed a crash if a paragraph has a link formatting code, but no font
|
||||
|
||||
## 5.0.0
|
||||
### MLEM
|
||||
Additions
|
||||
|
|
|
@ -236,8 +236,9 @@ namespace MLEM.Ui.Elements {
|
|||
/// <inheritdoc />
|
||||
public override void ForceUpdateArea() {
|
||||
// set the position offset and size to the token's first area
|
||||
var area = this.Token.GetArea(Vector2.Zero, this.textScale).First();
|
||||
var area = this.Token.GetArea(Vector2.Zero, this.textScale).FirstOrDefault();
|
||||
this.PositionOffset = area.Location + new Vector2(((Paragraph) this.Parent).GetAlignmentOffset() / this.Parent.Scale, 0);
|
||||
this.IsHidden = area.IsEmpty;
|
||||
this.Size = area.Size;
|
||||
base.ForceUpdateArea();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue