Remove unnecessary stuffs to draw fps counter faster for it to not affect fps much

This commit is contained in:
Jaex 2016-09-01 11:07:36 +03:00
parent 9f6b3cf63a
commit 44601e4e10
2 changed files with 4 additions and 21 deletions

View file

@ -222,7 +222,7 @@ protected override void OnPaint(PaintEventArgs e)
if (Config.ShowFPS)
{
CheckFPS();
DrawFPS(g);
DrawFPS(g, 10);
}
if (!pause)
@ -371,23 +371,9 @@ private void CheckFPS()
}
}
private void DrawFPS(Graphics g)
private void DrawFPS(Graphics g, int offset)
{
string text = "FPS: " + FPS;
SizeF textSize = g.MeasureString(text, infoFontBig);
int offset = 10;
Rectangle primaryScreenBounds = CaptureHelpers.GetPrimaryScreenBounds0Based();
Rectangle textRectangle = new Rectangle(primaryScreenBounds.X + offset, primaryScreenBounds.Y + offset, (int)textSize.Width, (int)textSize.Height);
if (textRectangle.Offset(10).Contains(InputManager.MousePosition0Based))
{
textRectangle.Y = primaryScreenBounds.Height - textRectangle.Height - offset;
}
ImageHelpers.DrawTextWithOutline(g, text, textRectangle.Location, infoFontBig, Color.White, Color.Black);
ImageHelpers.DrawTextWithShadow(g, FPS.ToString(), new Point(offset, offset), infoFontBig, Brushes.White, Brushes.Black, new Point(0, 1));
}
public IContainer components = null;

View file

@ -410,11 +410,8 @@ private static void task_TaskCompleted(WorkerTask task)
info.TaskSettings.AdvancedSettings.ToastWindowSize, toastConfig);
break;
}
}
if (info.IsUploadJob)
{
if (info.TaskSettings.AfterUploadJob.HasFlag(AfterUploadTasks.ShowAfterUploadWindow))
if (info.TaskSettings.AfterUploadJob.HasFlag(AfterUploadTasks.ShowAfterUploadWindow) && info.IsUploadJob)
{
AfterUploadForm dlg = new AfterUploadForm(info);
NativeMethods.ShowWindow(dlg.Handle, (int)WindowShowStyle.ShowNoActivate);