mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 20:58:34 +01:00
Revert "(attempt to) reduce element sizing incompatibilities for auto-width/height elements"
This reverts commit 094de058c4
.
This commit is contained in:
parent
094de058c4
commit
a9a7f2b421
2 changed files with 4 additions and 5 deletions
|
@ -30,7 +30,6 @@ Improvements
|
||||||
- Removed LINQ Any and All usage in various methods to improve memory usage
|
- Removed LINQ Any and All usage in various methods to improve memory usage
|
||||||
- Explicitly disallow creating Paragraphs without fonts to make starting out with MLEM.Ui less confusing
|
- Explicitly disallow creating Paragraphs without fonts to make starting out with MLEM.Ui less confusing
|
||||||
- Allow adding Link children to non-Paragraph elements
|
- Allow adding Link children to non-Paragraph elements
|
||||||
- Reduce sizing incompatibilities by ignoring percentage-based width and height for elements that set their width and height based on their children
|
|
||||||
|
|
||||||
Fixes
|
Fixes
|
||||||
- Fixed a crash if a paragraph has a link formatting code, but no font
|
- Fixed a crash if a paragraph has a link formatting code, but no font
|
||||||
|
|
|
@ -693,11 +693,11 @@ namespace MLEM.Ui.Elements {
|
||||||
/// <returns>The actual size of this element, taking <see cref="Scale"/> into account</returns>
|
/// <returns>The actual size of this element, taking <see cref="Scale"/> into account</returns>
|
||||||
protected virtual Vector2 CalcActualSize(RectangleF parentArea) {
|
protected virtual Vector2 CalcActualSize(RectangleF parentArea) {
|
||||||
var ret = new Vector2(
|
var ret = new Vector2(
|
||||||
this.size.X > 1 && !this.SetWidthBasedOnChildren ? this.ScaledSize.X : parentArea.Width * this.size.X,
|
this.size.X > 1 ? this.ScaledSize.X : parentArea.Width * this.size.X,
|
||||||
this.size.Y > 1 && !this.SetHeightBasedOnChildren ? this.ScaledSize.Y : parentArea.Height * this.size.Y);
|
this.size.Y > 1 ? this.ScaledSize.Y : parentArea.Height * this.size.Y);
|
||||||
if (this.size.X < 0 && !this.SetWidthBasedOnChildren)
|
if (this.size.X < 0)
|
||||||
ret.X = -this.size.X * ret.Y;
|
ret.X = -this.size.X * ret.Y;
|
||||||
if (this.size.Y < 0 && !this.SetHeightBasedOnChildren)
|
if (this.size.Y < 0)
|
||||||
ret.Y = -this.size.Y * ret.X;
|
ret.Y = -this.size.Y * ret.X;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue