aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/Label.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2017-02-09 09:06:45 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2017-02-09 09:06:45 +0100
commitff1d0f42b546fec1f45887be8addaa07b9fb5571 (patch)
treef7324a7c51e7c74b238dd7b3d8b1593845150cf0 /src/GraphicObjects/Label.cs
parente6614ed8048766ed69731cc4723a0e7432ed6134 (diff)
selection foreground for label
Diffstat (limited to 'src/GraphicObjects/Label.cs')
-rw-r--r--src/GraphicObjects/Label.cs23
1 files changed, 15 insertions, 8 deletions
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