From bd89f685deadcb7d703b58a7ff27d08daeeaee83 Mon Sep 17 00:00:00 2001 From: Daniel Cohen Gindi Date: Fri, 17 Jul 2015 16:30:12 +0300 Subject: [PATCH] Minor variable refactoring --- Charts/Classes/Renderers/BarChartRenderer.swift | 14 +++++++------- .../Renderers/HorizontalBarChartRenderer.swift | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Charts/Classes/Renderers/BarChartRenderer.swift b/Charts/Classes/Renderers/BarChartRenderer.swift index 9687b3be35..baeb49d099 100644 --- a/Charts/Classes/Renderers/BarChartRenderer.swift +++ b/Charts/Classes/Renderers/BarChartRenderer.swift @@ -153,7 +153,7 @@ public class BarChartRenderer: ChartDataRendererBase { var posY = 0.0 var negY = 0.0 - var y2 = 0.0 + var yStart = 0.0 // if drawing the bar shadow is enabled if (drawBarShadowEnabled) @@ -199,20 +199,20 @@ public class BarChartRenderer: ChartDataRendererBase if value >= 0.0 { y = posY - y2 = posY + value - posY = y2 + yStart = posY + value + posY = yStart } else { y = negY - y2 = negY + value - negY = y2 + yStart = negY + value + negY = yStart } var left = x - barWidth + barSpaceHalf var right = x + barWidth - barSpaceHalf - var top = y >= y2 ? CGFloat(y) : CGFloat(y2) - var bottom = y <= y2 ? CGFloat(y) : CGFloat(y2) + var top = y >= yStart ? CGFloat(y) : CGFloat(yStart) + var bottom = y <= yStart ? CGFloat(y) : CGFloat(yStart) // multiply the height of the rect with the phase top *= phaseY diff --git a/Charts/Classes/Renderers/HorizontalBarChartRenderer.swift b/Charts/Classes/Renderers/HorizontalBarChartRenderer.swift index d47ac37dff..6b37f4d70a 100644 --- a/Charts/Classes/Renderers/HorizontalBarChartRenderer.swift +++ b/Charts/Classes/Renderers/HorizontalBarChartRenderer.swift @@ -114,7 +114,7 @@ public class HorizontalBarChartRenderer: BarChartRenderer { var posY = 0.0 var negY = 0.0 - var y2 = 0.0 + var yStart = 0.0 // if drawing the bar shadow is enabled if (drawBarShadowEnabled) @@ -160,20 +160,20 @@ public class HorizontalBarChartRenderer: BarChartRenderer if value >= 0.0 { y = posY - y2 = posY + value - posY = y2 + yStart = posY + value + posY = yStart } else { y = negY - y2 = negY + value - negY = y2 + yStart = negY + value + negY = yStart } var bottom = x - barWidth + barSpaceHalf var top = x + barWidth - barSpaceHalf - var right = y >= y2 ? CGFloat(y) : CGFloat(y2) - var left = y <= y2 ? CGFloat(y) : CGFloat(y2) + var right = y >= yStart ? CGFloat(y) : CGFloat(yStart) + var left = y <= yStart ? CGFloat(y) : CGFloat(yStart) // multiply the height of the rect with the phase right *= phaseY