Skip to content

Commit

Permalink
Merge pull request #1 from MichaelMeinberg/MinMaxCrashFix
Browse files Browse the repository at this point in the history
Quick fix for the Max / Min issue.
  • Loading branch information
MichaelMeinberg authored Oct 4, 2021
2 parents e91ba71 + f42994e commit 3addf7d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ extension BarLineScatterCandleBubbleRenderer.XBounds: Sequence {
private var iterator: IndexingIterator<ClosedRange<Int>>

fileprivate init(min: Int, max: Int) {
guard min <= max else {
// If min is more then max, it crashes. Happens with large data in zooming and scrolling. Swap them to make it work.
self.iterator = (max...min).makeIterator()
return
}

self.iterator = (min...max).makeIterator()
}

Expand Down

0 comments on commit 3addf7d

Please sign in to comment.