From 3c3c3110e17b5128fafcbdce3912126ecc416b58 Mon Sep 17 00:00:00 2001 From: Chip Locke Date: Wed, 5 Dec 2018 00:30:31 -0800 Subject: [PATCH] don't need a stopwatch for redraw --- src/condo/Screen.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/condo/Screen.cs b/src/condo/Screen.cs index 581bfcc..eee722e 100644 --- a/src/condo/Screen.cs +++ b/src/condo/Screen.cs @@ -52,8 +52,6 @@ public ConsoleBuffer.Buffer Buffer private int consoleBufferSize; private SolidBrushCache brushCache = new SolidBrushCache(); - private static readonly TimeSpan MaxRedrawFrequency = TimeSpan.FromMilliseconds(1000); - private readonly Stopwatch redrawWatch = new Stopwatch(); private static readonly TimeSpan BlinkFrequency = TimeSpan.FromMilliseconds(250); private readonly Stopwatch cursorBlinkWatch = new Stopwatch(); @@ -85,7 +83,6 @@ public Screen(ConsoleBuffer.Buffer buffer) this.cellRectangle = new Rect(new Size(this.cellWidth, this.cellHeight)); this.Buffer = buffer; - this.redrawWatch.Start(); this.cursorBlinkWatch.Start(); CompositionTarget.Rendering += this.RenderFrame; @@ -117,9 +114,8 @@ private void OnBufferPropertyChanged(object sender, PropertyChangedEventArgs arg private void RenderFrame(object sender, EventArgs e) { - if (this.redrawWatch.Elapsed >= MaxRedrawFrequency && this.shouldRedraw != 0) + if (this.shouldRedraw != 0) { - this.redrawWatch.Restart(); this.shouldRedraw = 0; // when rendering we should update our view of the buffer size, and if we were previously scrolled