]> O.S.I.I.S - jp/crow.git/commitdiff
debug TextBox bottom limit with margin
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 6 Feb 2021 17:18:24 +0000 (18:18 +0100)
committerj-p <jp_bruyere@hotmail.com>
Sat, 6 Feb 2021 19:28:02 +0000 (20:28 +0100)
Crow/src/Widgets/Label.cs

index 6033a6f423f434332feb4582ee37d6258838640a..bec388685d37a764ef81f0c407beb509f53f121c 100644 (file)
@@ -355,7 +355,7 @@ namespace Crow
 
                                TextExtents extents;
                                Span<byte> bytes = stackalloc byte[128];
-                               double y = cb.Y;
+                               double y = 0;
 
                                for (int i = 0; i < lines.Count; i++) {
                                        if (!cancelLinePrint (lineHeight, y, cb.Height)) {
@@ -376,7 +376,7 @@ namespace Crow
 
                                                RectangleD lineRect = new RectangleD (
                                                        Width.IsFit && !Multiline ? cb.X : (int)getX (cb.Width, lines[i]) + cb.X,
-                                                       y, lines[i].LengthInPixel, lineHeight);
+                                                       y + cb.Top, lines[i].LengthInPixel, lineHeight);
 
                                                if (encodedBytes > 0) {
                                                        gr.MoveTo (lineRect.X, lineRect.Y + fe.Ascent);