From a76fb75200040168c29226cd0c6346913f8a319a Mon Sep 17 00:00:00 2001 From: "Murugan, Vimal" Date: Mon, 20 Jan 2020 11:53:22 +0530 Subject: [PATCH] crash fix --- MVMCoreUI/Molecules/Doughnut/DoughnutChart.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Molecules/Doughnut/DoughnutChart.swift b/MVMCoreUI/Molecules/Doughnut/DoughnutChart.swift index 130536e4..51532228 100644 --- a/MVMCoreUI/Molecules/Doughnut/DoughnutChart.swift +++ b/MVMCoreUI/Molecules/Doughnut/DoughnutChart.swift @@ -176,7 +176,7 @@ open class DoughnutChart: View { labelContainer.layoutIfNeeded() let radius = sizeObject.getValueBasedOnApplicationWidth()/2 - lineWidth() let labelheight = labelContainer.frame.height/2 - let padding = sizeObject.getValueBasedOnApplicationWidth()/2 - sqrt(pow(radius, 2) - pow(labelheight, 2)) + let padding = sizeObject.getValueBasedOnApplicationWidth()/2 - sqrt(abs(pow(radius, 2) - pow(labelheight, 2))) labelContainerLeftConstraint?.constant = padding labelContainerRightConstraint?.constant = padding