diff options
author | Mike Krüger <mikkrg@microsoft.com> | 2018-05-28 10:20:55 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2018-05-28 10:23:57 +0300 |
commit | 218c49943387072f02bca079105af549b555ebf0 (patch) | |
tree | e3d910d556193fc73822484d53848a137710cf65 | |
parent | e13e250032d6cd12405895c386bcc05b7b742886 (diff) |
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.
-rw-r--r-- | main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs | 4 | ||||
-rw-r--r-- | main/src/addins/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) |