From 218c49943387072f02bca079105af549b555ebf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Mon, 28 May 2018 09:20:55 +0200 Subject: Fixes issue #4906 Gutter on the left corrupts when you hover over the '...' associated with a compile error Seems that the clip rectangle is forgotten for the textViewCr when drawing on other Contexts occur in some - but not all - cases. Moving the clipping to the text view margin (where it belongs to btw.) corrects the behavior. --- .../addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs | 4 +--- .../MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index bd49e64473..6c713b1043 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -2265,9 +2265,7 @@ namespace Mono.TextEditor cr.LineWidth = Options.Zoom; textViewCr.LineWidth = Options.Zoom; - textViewCr.Rectangle (textViewMargin.XOffset, 0, Allocation.Width - textViewMargin.XOffset, Allocation.Height); - textViewCr.Clip (); - + RenderMargins (cr, textViewCr, cairoArea); #if DEBUG_EXPOSE diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs index ec4a293298..9d3cd104fa 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs @@ -3075,6 +3075,9 @@ namespace Mono.TextEditor { // double xStart = System.Math.Max (area.X, XOffset); // xStart = System.Math.Max (0, xStart); + cr.Rectangle (XOffset, 0, textEditor.Allocation.Width - XOffset, textEditor.Allocation.Height); + cr.Clip (); + var correctedXOffset = System.Math.Floor (XOffset) - 1; var extendingMarker = line != null ? (IExtendingTextLineMarker)textEditor.Document.GetMarkers (line).FirstOrDefault (l => l is IExtendingTextLineMarker) : null; isSpaceAbove = extendingMarker != null ? extendingMarker.IsSpaceAbove : false; @@ -3306,6 +3309,7 @@ namespace Mono.TextEditor DrawScrollShadow (cr, x, y, _lineHeight); if (wrapper != null && wrapper.IsUncached) wrapper.Dispose (); + cr.ResetClip (); } void DrawScrollShadow (Cairo.Context cr, double x, double y, double _lineHeight) -- cgit v1.2.3