mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-28 08:47:59 +01:00
More appropriate solution for the issue #2331.
This commit is contained in:
@@ -1575,8 +1575,18 @@ namespace Terminal.Gui {
|
||||
var driverClip = Driver == null ? Rect.Empty : Driver.Clip;
|
||||
containerBounds.X = Math.Max (containerBounds.X, driverClip.X);
|
||||
containerBounds.Y = Math.Max (containerBounds.Y, driverClip.Y);
|
||||
containerBounds.Width = Math.Min (containerBounds.Width, driverClip.Width);
|
||||
containerBounds.Height = Math.Min (containerBounds.Height, driverClip.Height);
|
||||
var lenOffset = (driverClip.X + driverClip.Width) - (containerBounds.X + containerBounds.Width);
|
||||
if (containerBounds.X + containerBounds.Width > driverClip.X + driverClip.Width) {
|
||||
containerBounds.Width = Math.Max (containerBounds.Width + lenOffset, 0);
|
||||
} else {
|
||||
containerBounds.Width = Math.Min (containerBounds.Width, driverClip.Width);
|
||||
}
|
||||
lenOffset = (driverClip.Y + driverClip.Height) - (containerBounds.Y + containerBounds.Height);
|
||||
if (containerBounds.Y + containerBounds.Height > driverClip.Y + driverClip.Height) {
|
||||
containerBounds.Height = Math.Max (containerBounds.Height + lenOffset, 0);
|
||||
} else {
|
||||
containerBounds.Height = Math.Min (containerBounds.Height, driverClip.Height);
|
||||
}
|
||||
return containerBounds;
|
||||
}
|
||||
|
||||
|
||||
@@ -329,11 +329,10 @@ namespace Terminal.Gui {
|
||||
//Clear ();
|
||||
|
||||
var savedClip = ClipToBounds ();
|
||||
var rect = new Rect (new Point (-contentView.Frame.X, -contentView.Frame.Y),
|
||||
OnDrawContent (new Rect (ContentOffset,
|
||||
new Size (Math.Max (Bounds.Width - (ShowVerticalScrollIndicator ? 1 : 0), 0),
|
||||
Math.Max (Bounds.Height - (ShowHorizontalScrollIndicator ? 1 : 0), 0)));
|
||||
OnDrawContent (rect);
|
||||
contentView.Redraw (rect);
|
||||
Math.Max (Bounds.Height - (ShowHorizontalScrollIndicator ? 1 : 0), 0))));
|
||||
contentView.Redraw (contentView.Frame);
|
||||
Driver.Clip = savedClip;
|
||||
|
||||
if (autoHideScrollBars) {
|
||||
@@ -509,7 +508,7 @@ namespace Terminal.Gui {
|
||||
{
|
||||
if (me.Flags != MouseFlags.WheeledDown && me.Flags != MouseFlags.WheeledUp &&
|
||||
me.Flags != MouseFlags.WheeledRight && me.Flags != MouseFlags.WheeledLeft &&
|
||||
// me.Flags != MouseFlags.Button1Pressed && me.Flags != MouseFlags.Button1Clicked &&
|
||||
// me.Flags != MouseFlags.Button1Pressed && me.Flags != MouseFlags.Button1Clicked &&
|
||||
!me.Flags.HasFlag (MouseFlags.Button1Pressed | MouseFlags.ReportMousePosition)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user