mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-15 08:34:22 +00:00
[ios] Skip zoom/pinch gesture when the lower/upper is out of bounds
The previous check `if upper - lower < chartData.labels.count / 10 return` produces invalid state for drawing and fails when the upper == lower. Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
committed by
Yannik Bloscheck
parent
ef2dea20fe
commit
38406b149a
@@ -244,10 +244,10 @@ public class ChartView: UIView {
|
||||
let lower = max(pinchStartLower + dx, 0)
|
||||
let upper = min(pinchStartUpper - dx, chartData.labels.count - 1)
|
||||
|
||||
if upper - lower < chartData.labels.count / 10 {
|
||||
guard upper - lower > max(1, chartData.labels.count / 10) else {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
chartPreviewView.setX(min: lower, max: upper)
|
||||
xAxisView.setBounds(lower: lower, upper: upper)
|
||||
updateCharts(animationStyle: .none)
|
||||
|
||||
Reference in New Issue
Block a user