aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-02 11:14:33 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-02 11:14:33 +0100
commit7fe5cc0563fa79df34c2b8fe5ca6283de7555b75 (patch)
tree3d8eb4a871808e468a2999278939ce6ed8255729 /src/GraphicObjects
parenta05237cad3a83ce89675ae5296eb416c7bba4ce0 (diff)
test stretched text, debug
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/Label.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index 68cd50b6..1af9e04b 100644
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -379,8 +379,8 @@ namespace Crow
case Alignment.RightStretch://ok
heightRatio = widthRatio = (float)cb.Height / rText.Height;
rText.Height = cb.Height;
- rText.Width = (int)(widthRatio * cb.Width);
- rText.X = cb.X;
+ rText.Width = (int)(widthRatio * rText.Width);
+ rText.X = cb.Right - rText.Width;
rText.Y = cb.Y;
break;
case Alignment.BottomCenter://ok
@@ -429,7 +429,9 @@ namespace Crow
break;
}
}
- OpenTKGameWindow.currentWindow.CursorVisible = true;
+
+ gr.FontMatrix = new Matrix(widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);
+ fe = gr.FontExtents;
#region draw text cursor
if (mouseLocalPos >= 0)
@@ -487,8 +489,7 @@ namespace Crow
gr.LineTo(new PointD(textCursorPos + rText.X, rText.Y + (CurrentLine + 1) * fe.Height));
gr.Stroke();
}
- gr.FontMatrix = new Matrix(widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);
- OpenTKGameWindow.currentWindow.CursorVisible = true;
+
for (int i = 0; i < lines.Count; i++) {
string l = lines [i].Replace ("\t", new String (' ', Interface.TabSize));
int lineLength = (int)gr.TextExtents (l).XAdvance;