update left and right padding
This commit is contained in:
parent
a318b19410
commit
9329f0ca15
@ -173,10 +173,15 @@ open class DoughnutChart: View, MVMCoreUIViewConstrainingProtocol {
|
||||
return doughnutChartModel?.spaceRequired ?? true
|
||||
}
|
||||
|
||||
func updateLabelContainer() {
|
||||
labelContainer.leftPin?.constant = lineWidth()
|
||||
labelContainer.topPin?.constant = lineWidth()
|
||||
labelContainer.setNeedsDisplay()
|
||||
}
|
||||
func updateLabelContainer() {
|
||||
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))
|
||||
|
||||
labelContainer.leftPin?.constant = padding
|
||||
labelContainer.topPin?.constant = padding
|
||||
labelContainer.setNeedsDisplay()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user