diff --git a/src/client/spark/view/Spark/Ladder/LaderRender.cs b/src/client/spark/view/Spark/Ladder/LaderRender.cs index 109141331..665da5c13 100644 --- a/src/client/spark/view/Spark/Ladder/LaderRender.cs +++ b/src/client/spark/view/Spark/Ladder/LaderRender.cs @@ -232,13 +232,15 @@ namespace mbts.spark { return; int curr_index = origin_index; double curr_price = prices[origin_index]; - foreach (var pd in data) { + foreach (var (price, value) in data) { + if (double.IsNaN(price)) + continue; // prices are in descending order, so get diff from curr_price - price - int tick_diff = spec.tickdiff(curr_price, pd.price) ?? 0; + int tick_diff = spec.tickdiff(curr_price, price) ?? 0; curr_index += tick_diff; - curr_price = pd.price; + curr_price = price; if (curr_index >= 0 && curr_index < prices.Length) { - render_cell(dc, curr_index, pd.value); + render_cell(dc, curr_index, value); } else break; } }