aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/Label.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-07-30 15:32:52 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-07-30 15:32:52 +0200
commitbe8a4c2923ee9a62646590576cdf2fcdbf0d39a3 (patch)
tree502c57dbb061065e252701ada79f06ef183cb841 /src/GraphicObjects/Label.cs
parent6c6fb760bfb6a956a3413abfb56571a11113acd3 (diff)
basic styling ok, need handler and expression now.
Diffstat (limited to 'src/GraphicObjects/Label.cs')
-rw-r--r--src/GraphicObjects/Label.cs16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index e1bf02a7..9af86266 100644
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -383,11 +383,8 @@ namespace Crow
foreach (string s in lines) {
string l = s.Replace("\t", new String (' ', Interface.TabSize));
-#if _WIN32 || _WIN64
- TextExtents tmp = gr.TextExtents(str.ToUtf8());
-#elif __linux__
TextExtents tmp = gr.TextExtents (l);
-#endif
+
if (tmp.XAdvance > te.XAdvance)
te = tmp;
}
@@ -582,11 +579,8 @@ namespace Crow
Foreground.SetAsSource (gr);
gr.MoveTo (lineRect.X, rText.Y + fe.Ascent + fe.Height * i);
- #if _WIN32 || _WIN64
- gr.ShowText(l.ToUtf8());
- #elif __linux__
gr.ShowText (l);
- #endif
+
gr.Fill ();
}
}
@@ -675,12 +669,8 @@ namespace Crow
if (c == "\t")
c = new string (' ', Interface.TabSize);
- #if _WIN32 || _WIN64
- byte[] c = System.Text.UTF8Encoding.UTF8.GetBytes(Text.Substring(i, 1));
te = gr.TextExtents(c);
- #elif __linux__
- te = gr.TextExtents(c);
- #endif
+
double halfWidth = te.XAdvance / 2;
if (mouseLocalPos.X <= cPos + halfWidth)