From: jpbruyere Date: Thu, 9 Feb 2017 08:06:45 +0000 (+0100) Subject: selection foreground for label X-Git-Tag: v0.5.1~15 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=5ca711641d1934adf08d2675641e3f61647f3ffc;p=jp%2Fcrow.git selection foreground for label --- diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs index 1cf9e6ef..071dc79f 100644 --- a/src/GraphicObjects/Label.cs +++ b/src/GraphicObjects/Label.cs @@ -617,6 +617,14 @@ namespace Crow // TextAlignment == Alignment.TopRight || // TextAlignment == Alignment.BottomRight) // lineRect.X += (rText.Width - lineLength); + if (string.IsNullOrWhiteSpace (l)) + continue; + + Foreground.SetAsSource (gr); + gr.MoveTo (lineRect.X, rText.Y + fe.Ascent + fe.Height * i); + gr.ShowText (l); + gr.Fill (); + if (Selectable) { if (SelRelease >= 0 && i >= selectionStart.Y && i <= selectionEnd.Y) { gr.SetSourceColor (selBackground); @@ -639,17 +647,16 @@ namespace Crow selRect.Width -= (lineLength - cpEnd); gr.Rectangle (selRect); + gr.FillPreserve (); + gr.Save (); + gr.Clip (); + gr.SetSourceColor (SelectionForeground); + gr.MoveTo (lineRect.X, rText.Y + fe.Ascent + fe.Height * i); + gr.ShowText (l); gr.Fill (); + gr.Restore (); } } - - if (string.IsNullOrWhiteSpace (l)) - continue; - - Foreground.SetAsSource (gr); - gr.MoveTo (lineRect.X, rText.Y + fe.Ascent + fe.Height * i); - gr.ShowText (l); - gr.Fill (); } } #endregion