diff options
| author | Michael <[email protected]> | 2017-08-07 13:46:04 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-08-07 13:46:04 -0400 |
| commit | 326d29db45b18a2d5c11012475c65b24e4c96d26 (patch) | |
| tree | 281280bd2d27b23b4e9925c0b9b9d25bf5f2e634 /ShiftOS.Frontend/Apps | |
| parent | e07c2f58baa41ac0bc53f338c1e5f88478c0cd1b (diff) | |
| download | shiftos_thereturn-326d29db45b18a2d5c11012475c65b24e4c96d26.tar.gz shiftos_thereturn-326d29db45b18a2d5c11012475c65b24e4c96d26.tar.bz2 shiftos_thereturn-326d29db45b18a2d5c11012475c65b24e4c96d26.zip | |
oced bug is slightly less of an issue
Diffstat (limited to 'ShiftOS.Frontend/Apps')
| -rw-r--r-- | ShiftOS.Frontend/Apps/Terminal.cs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/ShiftOS.Frontend/Apps/Terminal.cs b/ShiftOS.Frontend/Apps/Terminal.cs index 5bedcf0..ff06dd0 100644 --- a/ShiftOS.Frontend/Apps/Terminal.cs +++ b/ShiftOS.Frontend/Apps/Terminal.cs @@ -400,8 +400,14 @@ namespace ShiftOS.Frontend.Apps } //Draw the text + int textloc = 0 - (int)_vertOffset; + foreach (var line in Lines) + { + if(!(textloc < 0 || textloc - font.Height >= Height)) + gfx.DrawString(line, 0, textloc, LoadedSkin.TerminalForeColorCC.ToColor().ToMonoColor(), font, Width - 4); + textloc += font.Height; + } - gfx.DrawString(Text, 0, (int)(0 - _vertOffset), LoadedSkin.TerminalForeColorCC.ToColor().ToMonoColor(), font, Width - 4); } } @@ -454,16 +460,8 @@ namespace ShiftOS.Frontend.Apps { public static SizeF SmartMeasureString(this Graphics gfx, string s, Font font, int width) { - var textformat = new StringFormat(StringFormat.GenericTypographic); - textformat.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces; - //textformat.Trimming = StringTrimming.Character; - //textformat.FormatFlags |= StringFormatFlags.NoClip; - - gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; - var measure = gfx.MeasureString(s, font, width, textformat); - if (string.IsNullOrEmpty(s)) - measure.Width = 0; - return new SizeF((float)Math.Ceiling(Math.Max(1,measure.Width)), (float)Math.Ceiling(Math.Max(1,measure.Height))); + var measure = System.Windows.Forms.TextRenderer.MeasureText(s, font, new Size(width, int.MaxValue)); + return measure; } public static SizeF SmartMeasureString(this Graphics gfx, string s, Font font) |
