Fixes #290 issue "Redraw issue when setting coordinates of label"

This commit is contained in:
BDisp
2019-11-13 22:27:54 +00:00
parent 153824ae3b
commit bc5609012c

View File

@@ -430,7 +430,7 @@ namespace Terminal.Gui {
SetNeedsDisplay (Bounds);
}
bool layoutNeeded = true;
internal bool layoutNeeded = true;
internal void SetNeedsLayout ()
{
@@ -2054,11 +2054,28 @@ namespace Terminal.Gui {
DrawBounds (state.Toplevel);
state.Toplevel.PositionCursor ();
Driver.Refresh ();
} else if (CheckLayoutNeeded (state.Toplevel)) {
TerminalResized ();
layoutNeeded = false;
} else
Driver.UpdateCursor ();
}
}
static bool layoutNeeded;
static bool CheckLayoutNeeded (View view)
{
if (view.layoutNeeded)
return layoutNeeded = view.layoutNeeded;
for (int i = 0; view.Subviews.Count > i; i++) {
CheckLayoutNeeded (view.Subviews [i]);
if (layoutNeeded)
return layoutNeeded;
}
return layoutNeeded;
}
internal static bool DebugDrawBounds;
// Need to look into why this does not work properly.