mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fixed Adornment.FrameToscreen bug
This commit is contained in:
@@ -100,17 +100,19 @@ public class Adornment : View
|
||||
/// <inheritdoc/>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>Does nothing for Adornment</summary>
|
||||
|
||||
Reference in New Issue
Block a user