fix: Do not double fetch root parent (#1333)

This commit is contained in:
Kamron Batman 2023-02-05 12:09:08 -08:00 committed by GitHub
parent 9bb0dbf1ac
commit 14ef1ab7e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1057,9 +1057,11 @@ public sealed class Map : IComparable<Map>, ISpanFormattable, ISpanParsable<Map>
}
else if (o is Item item)
{
if (item.RootParent != null)
// Calculate the height based on the container, not the item inside.
var rootParent = item.RootParent;
if (rootParent != null)
{
p = GetPoint(item.RootParent, eye);
p = GetPoint(rootParent, eye);
}
else
{