diff --git a/Terminal.Gui/View/Adornment/Adornment.cs b/Terminal.Gui/View/Adornment/Adornment.cs index 221853b85..4f47e6e02 100644 --- a/Terminal.Gui/View/Adornment/Adornment.cs +++ b/Terminal.Gui/View/Adornment/Adornment.cs @@ -100,17 +100,19 @@ public class Adornment : View /// public override Rectangle FrameToScreen () { + if (Parent is null) + { + return Frame; + } + // Adornments are *Children* of a View, not SubViews. Thus View.FrameToScreen will not work. // To get the screen-relative coordinates of a Adornment, we need to know who // the Parent is - Rectangle ret = Parent?.Frame ?? Frame; - ret.Size = Frame.Size; - - ret.Location = Parent?.FrameToScreen ().Location ?? ret.Location; + Rectangle parent = Parent.FrameToScreen (); // We now have coordinates relative to our View. If our View's SuperView has // a SuperView, keep going... - return ret; + return new (new (parent.X + Frame.X, parent.Y + Frame.Y), Frame.Size); } /// Does nothing for Adornment