diff options
| author | Michael <[email protected]> | 2017-07-11 15:02:44 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-07-11 15:02:44 -0400 |
| commit | f911bf5f5b5bcd5385483348c1ccb172aa737126 (patch) | |
| tree | e453c89d1a9dc2cb2db82106118d85529d501179 /ShiftOS.Frontend/GraphicsSubsystem | |
| parent | 2f54ddc6b05d7f48d6a22735f08917fab1f96ba4 (diff) | |
| download | shiftos_thereturn-f911bf5f5b5bcd5385483348c1ccb172aa737126.tar.gz shiftos_thereturn-f911bf5f5b5bcd5385483348c1ccb172aa737126.tar.bz2 shiftos_thereturn-f911bf5f5b5bcd5385483348c1ccb172aa737126.zip | |
Fix fuzzy text rendering and fix wrapping
Diffstat (limited to 'ShiftOS.Frontend/GraphicsSubsystem')
| -rw-r--r-- | ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs | 4 | ||||
| -rw-r--r-- | ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs | 14 |
2 files changed, 15 insertions, 3 deletions
diff --git a/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs b/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs index 772abc4..e2b93fe 100644 --- a/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs +++ b/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs @@ -160,9 +160,9 @@ namespace ShiftOS.Frontend.GraphicsSubsystem var sFormat = System.Drawing.StringFormat.GenericTypographic; sFormat.FormatFlags |= System.Drawing.StringFormatFlags.NoClip; - gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; + gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; - gfx.DrawString(text, font, System.Drawing.Brushes.White, 0, 0, sFormat); + gfx.DrawString(text, font, System.Drawing.Brushes.White, new System.Drawing.RectangleF(0, 0, bmp.Width, bmp.Height), sFormat); } var lck = bmp.LockBits(new System.Drawing.Rectangle(0, 0, bmp.Width, bmp.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); diff --git a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs index d8fdf2e..942b8b6 100644 --- a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs +++ b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs @@ -94,6 +94,18 @@ namespace ShiftOS.Frontend.GraphicsSubsystem else { _target = TextureCaches[hc]; + if(_target.Width != ctrl.Width || _target.Height != ctrl.Height) + { + _target = new RenderTarget2D( + graphics, + ctrl.Width, + ctrl.Height, + false, + graphics.PresentationParameters.BackBufferFormat, + DepthFormat.Depth24); + TextureCaches[hc] = _target; + + } } if (ctrl.RequiresPaint) { @@ -188,7 +200,7 @@ namespace ShiftOS.Frontend.GraphicsSubsystem { var color = (System.Drawing.Color)colorfield.GetValue(SkinEngine.LoadedSkin); var tex2 = new Texture2D(graphics, 1, 1); - tex2.SetData<byte>(new[] { color.B, color.G, color.R, color.A }); + tex2.SetData<byte>(new[] { color.R, color.G, color.B, color.A }); SkinTextures.Add(colorfield.Name, tex2); } |
