Skip to content

Commit

Permalink
Fix turning off drag in X and Y axes separately.
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejtrybilo committed Nov 2, 2017
1 parent bdbdaa6 commit 37c8a77
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/Charts/Charts/BarLineChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -871,9 +871,11 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD
{
if gestureRecognizer == _panGestureRecognizer
{
if _data === nil ||
!isDragEnabled ||
(self.hasNoDragOffset && self.isFullyZoomedOut && !self.isHighlightPerDragEnabled)
let velocity = _panGestureRecognizer.velocity(in: self)
if _data === nil || !isDragEnabled ||
(self.hasNoDragOffset && self.isFullyZoomedOut && !self.isHighlightPerDragEnabled) ||
(!_dragYEnabled && fabs(velocity.y) > fabs(velocity.x)) ||
(!_dragXEnabled && fabs(velocity.y) < fabs(velocity.x))
{
return false
}
Expand Down

0 comments on commit 37c8a77

Please sign in to comment.