Skip to content

Commit

Permalink
Merge pull request #2949 from maciejtrybilo/master
Browse files Browse the repository at this point in the history
Fix turning off drag in X and Y axes separately.
  • Loading branch information
liuxuan30 authored Dec 5, 2017
2 parents b87d04e + 37c8a77 commit 60829b3
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 @@ -868,9 +868,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 60829b3

Please sign in to comment.