mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fix window render
This commit is contained in:
@@ -141,12 +141,12 @@ namespace Terminal {
|
|||||||
internal void ViewToScreen (int col, int row, out int rcol, out int rrow, bool clipped = true)
|
internal void ViewToScreen (int col, int row, out int rcol, out int rrow, bool clipped = true)
|
||||||
{
|
{
|
||||||
// Computes the real row, col relative to the screen.
|
// Computes the real row, col relative to the screen.
|
||||||
rrow = row;
|
rrow = row + frame.X;
|
||||||
rcol = col;
|
rcol = col + frame.Y;
|
||||||
var ccontainer = container;
|
var ccontainer = container;
|
||||||
while (ccontainer != null){
|
while (ccontainer != null){
|
||||||
rrow += container.frame.Y;
|
rrow += ccontainer.frame.Y;
|
||||||
rcol += container.frame.X;
|
rcol += ccontainer.frame.X;
|
||||||
ccontainer = ccontainer.container;
|
ccontainer = ccontainer.container;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,7 +419,7 @@ namespace Terminal {
|
|||||||
|
|
||||||
void DrawFrame ()
|
void DrawFrame ()
|
||||||
{
|
{
|
||||||
DrawFrame (Frame, true);
|
DrawFrame (new Rect (Point.Empty, Frame.Size), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Redraw ()
|
public override void Redraw ()
|
||||||
@@ -431,7 +431,7 @@ namespace Terminal {
|
|||||||
Driver.SetColor (Colors.Dialog.Normal);
|
Driver.SetColor (Colors.Dialog.Normal);
|
||||||
var width = Frame.Width;
|
var width = Frame.Width;
|
||||||
if (Title != null && width > 4) {
|
if (Title != null && width > 4) {
|
||||||
Move (0, 1);
|
Move (1, 0);
|
||||||
Driver.AddCh (' ');
|
Driver.AddCh (' ');
|
||||||
var str = Title.Length > width ? Title.Substring (0, width - 4) : Title;
|
var str = Title.Length > width ? Title.Substring (0, width - 4) : Title;
|
||||||
Driver.AddStr (str);
|
Driver.AddStr (str);
|
||||||
|
|||||||
2
demo.cs
2
demo.cs
@@ -5,7 +5,7 @@ class Demo {
|
|||||||
{
|
{
|
||||||
Application.Init ();
|
Application.Init ();
|
||||||
var top = Application.Top;
|
var top = Application.Top;
|
||||||
top.Add (new Window (new Rect (10, 10, 20, 20), "Hello"));
|
top.Add (new Window (new Rect (10, 10, 20, 10), "Hello"));
|
||||||
Application.Run ();
|
Application.Run ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user