From 0ccde088a78a8eb40e03007034ab6b5f24d3508d Mon Sep 17 00:00:00 2001 From: George Wu Date: Tue, 25 Oct 2016 21:52:45 +0200 Subject: [PATCH] [director] Fixed a crash when zooming too fast. --- .../UI/Controls/ScoreBar.Rendering.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DereTore.Applications.StarlightDirector/UI/Controls/ScoreBar.Rendering.cs b/DereTore.Applications.StarlightDirector/UI/Controls/ScoreBar.Rendering.cs index f28e29b..76e245c 100644 --- a/DereTore.Applications.StarlightDirector/UI/Controls/ScoreBar.Rendering.cs +++ b/DereTore.Applications.StarlightDirector/UI/Controls/ScoreBar.Rendering.cs @@ -42,6 +42,10 @@ private void DrawBar(DrawingContext context) { var visibleGridCountPerSignature = gridPerSignature / zoomMod; var hasPartialGrids = visibleGridCountPerSignature * zoomMod != gridPerSignature; + if (visibleGridCountPerSignature <= 0) { + return; + } + for (var i = 0; i <= totalGridCount; ++i) { if (i % zoomMod != 0 && i != totalGridCount) { // Only draws key beats.