aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend/GraphicsSubsystem
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.Frontend/GraphicsSubsystem')
-rw-r--r--ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs4
-rw-r--r--ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs14
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);
}