diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-14 06:43:59 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-14 06:43:59 +0200 |
| commit | 9d0137b1d39e62b09437b6a11e8dcf1318e2a7eb (patch) | |
| tree | 6f34808a56eb5562bdfd5306ec2ad74c935d964b /src/GraphicObjects/Label.cs | |
| parent | 854f2f732acc4c1d9fa4126962149cae14f4d4e9 (diff) | |
* Crow.csproj, XCursor.cs, Interface.cs, ibeam:
text xcursor
* Window.template, Expandable.template, TabView.cs, 0.crow:
divers
* ExtensionsMethods.cs, CairoHelpers.cs, Border.cs:
stroke better alignment, should be reworked for different width
* Label.cs:
text xcursor, selection rectangles adjustments
* Window.cs:
Maximize
Diffstat (limited to 'src/GraphicObjects/Label.cs')
| -rw-r--r-- | src/GraphicObjects/Label.cs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs index 3cc0f916..37a32a2f 100644 --- a/src/GraphicObjects/Label.cs +++ b/src/GraphicObjects/Label.cs @@ -569,8 +569,8 @@ namespace Crow Foreground.SetAsSource (gr); gr.LineWidth = 1.0; - gr.MoveTo(new PointD(textCursorPos + rText.X, rText.Y + CurrentLine * fe.Height)); - gr.LineTo(new PointD(textCursorPos + rText.X, rText.Y + (CurrentLine + 1) * fe.Height)); + gr.MoveTo (0.5 + textCursorPos + rText.X, rText.Y + CurrentLine * fe.Height); + gr.LineTo (0.5 + textCursorPos + rText.X, rText.Y + (CurrentLine + 1) * fe.Height); gr.Stroke(); } #endregion @@ -603,9 +603,9 @@ namespace Crow int lineLength = (int)gr.TextExtents (l).XAdvance; Rectangle lineRect = new Rectangle ( rText.X, - rText.Y + (int)(i * fe.Height), - lineLength, - (int)fe.Height); + rText.Y + (int)Math.Ceiling(i * fe.Height), + lineLength, + (int)Math.Ceiling(fe.Height)); // if (TextAlignment == Alignment.Center || // TextAlignment == Alignment.Top || @@ -659,6 +659,17 @@ namespace Crow if (mouseLocalPos.Y < 0) mouseLocalPos.Y = 0; } + public override void onMouseEnter (object sender, MouseMoveEventArgs e) + { + base.onMouseEnter (sender, e); + if (Selectable) + Interface.CurrentInterface.MouseCursor = XCursor.Text; + } + public override void onMouseLeave (object sender, MouseMoveEventArgs e) + { + base.onMouseLeave (sender, e); + Interface.CurrentInterface.MouseCursor = XCursor.Default; + } public override void onFocused (object sender, EventArgs e) { base.onFocused (sender, e); |