Skip to content

Commit

Permalink
don't need a stopwatch for redraw
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleyewdee committed Dec 5, 2018
1 parent 5325d4a commit 3c3c311
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/condo/Screen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3c3c311

Please sign in to comment.