From 978cc9922b1f49a2332a18e94b450e4d97fd7477 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Fri, 15 Dec 2017 19:46:17 -0500 Subject: [PATCH] Fix window render --- Application.cs | 12 ++++++------ demo.cs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Application.cs b/Application.cs index 611094835..4884568f9 100644 --- a/Application.cs +++ b/Application.cs @@ -141,12 +141,12 @@ namespace Terminal { 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. - rrow = row; - rcol = col; + rrow = row + frame.X; + rcol = col + frame.Y; var ccontainer = container; while (ccontainer != null){ - rrow += container.frame.Y; - rcol += container.frame.X; + rrow += ccontainer.frame.Y; + rcol += ccontainer.frame.X; ccontainer = ccontainer.container; } @@ -419,7 +419,7 @@ namespace Terminal { void DrawFrame () { - DrawFrame (Frame, true); + DrawFrame (new Rect (Point.Empty, Frame.Size), true); } public override void Redraw () @@ -431,7 +431,7 @@ namespace Terminal { Driver.SetColor (Colors.Dialog.Normal); var width = Frame.Width; if (Title != null && width > 4) { - Move (0, 1); + Move (1, 0); Driver.AddCh (' '); var str = Title.Length > width ? Title.Substring (0, width - 4) : Title; Driver.AddStr (str); diff --git a/demo.cs b/demo.cs index 0fe06b99c..cb9d8cee8 100644 --- a/demo.cs +++ b/demo.cs @@ -5,7 +5,7 @@ class Demo { { Application.Init (); 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 (); } } \ No newline at end of file