Skip to content

Commit

Permalink
Merge pull request #1319 from essoecc/scaleEnabled
Browse files Browse the repository at this point in the history
Refined scaleXEnabled/scaleYEnabled conditioning
  • Loading branch information
danielgindi committed Aug 14, 2016
2 parents 72b6fb3 + 2b6ac7c commit b4282a8
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Charts/Classes/Charts/BarLineChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -573,13 +573,27 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
let x = abs(recognizer.locationInView(self).x - recognizer.nsuiLocationOfTouch(1, inView: self).x)
let y = abs(recognizer.locationInView(self).y - recognizer.nsuiLocationOfTouch(1, inView: self).y)

if (x > y)
if (_scaleXEnabled != _scaleYEnabled)
{
_gestureScaleAxis = .X
if (_scaleXEnabled)
{
_gestureScaleAxis = .X
}
else
{
_gestureScaleAxis = .Y
}
}
else
{
_gestureScaleAxis = .Y
if (x > y)
{
_gestureScaleAxis = .X
}
else
{
_gestureScaleAxis = .Y
}
}
}
}
Expand Down

0 comments on commit b4282a8

Please sign in to comment.