Charlie Kindel 5 years ago
parent
commit
549c8c0604

+ 1 - 1
Terminal.Gui/Core/ConsoleDriver.cs

@@ -5,7 +5,7 @@
 //   Miguel de Icaza ([email protected])
 //
 // Define this to enable diagnostics drawing for Window Frames
-//#define DRAW_WINDOW_FRAME_DIAGNOSTICS
+#define DRAW_WINDOW_FRAME_DIAGNOSTICS
 using NStack;
 using System;
 using System.Runtime.CompilerServices;

+ 2 - 1
Terminal.Gui/Core/View.cs

@@ -891,7 +891,8 @@ namespace Terminal.Gui {
 							Application.CurrentView = view;
 
 							// Ensure we don't make the Driver's clip rect any bigger
-							if (Driver.Clip.IsEmpty || Driver.Clip.Contains(RectToScreen (view.Frame))) {
+							if (SuperView != null && SuperView.Bounds.Contains (RectToScreen (Frame))) {
+							//if (Driver.Clip.IsEmpty || Driver.Clip.Contains(RectToScreen (view.Frame))) {
 								var savedClip = view.ClipToBounds ();
 								view.Redraw (view.Bounds);
 								Driver.Clip = savedClip;

+ 6 - 2
Terminal.Gui/Views/ScrollView.cs

@@ -404,11 +404,15 @@ namespace Terminal.Gui {
 			Driver.SetAttribute (ColorScheme.Normal);
 			Clear ();
 
+			if (Driver.Clip.IsEmpty || Driver.Clip.Contains (RectToScreen (Frame))) {
 			var savedClip = ClipToBounds ();
-			contentView.Redraw (contentView.Bounds);
+			contentView.Redraw (contentView.Frame);
+			Driver.Clip = savedClip;
+			} else {
+				contentView.Redraw (contentView.Bounds);
+			}
 			vertical.Redraw (vertical.Bounds);
 			horizontal.Redraw (vertical.Bounds);
-			Driver.Clip = savedClip;
 			Driver.SetAttribute (ColorScheme.Normal);
 		}
 

+ 1 - 2
UICatalog/Properties/launchSettings.json

@@ -1,8 +1,7 @@
 {
   "profiles": {
     "UICatalog": {
-      "commandName": "Project",
-      "commandLineArgs": "Scrolling"
+      "commandName": "Project"
     }
   }
 }

+ 4 - 0
UICatalog/Scenarios/Scrolling.cs

@@ -9,6 +9,10 @@ namespace UICatalog {
 	class Scrolling : Scenario {
 		public override void Setup ()
 		{
+			Win.X = 1;
+			Win.Y = 2;
+			Win.Width = Dim.Fill () - 4;
+			Win.Height = Dim.Fill () - 2;
 			var label = new Label ("ScrollView (new Rect (2, 2, 50, 20)) with a 200, 100 ContentSize...") {
 				X = 0, Y = 0,
 				ColorScheme = Colors.Dialog