Merge branch 'bugfix/label_layout_constraint_fix' into 'feature/coding'
Bugfix/label layout constraint fix See merge request BPHV_MIPS/mvm_core_ui!227
This commit is contained in:
commit
747132f72d
@ -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(max(0, pow(radius, 2) - pow(labelheight, 2)))
|
||||
|
||||
labelContainerLeftConstraint?.constant = padding
|
||||
labelContainerRightConstraint?.constant = padding
|
||||
|
||||
@ -26,7 +26,7 @@ import Foundation
|
||||
addSubview(colorLablesStack)
|
||||
|
||||
doughnutChart.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
||||
doughnutChart.topAnchor.constraint(equalTo: topAnchor, constant: PaddingFour).isActive = true
|
||||
doughnutChart.topAnchor.constraint(equalTo: topAnchor).isActive = true
|
||||
bottomAnchor.constraint(greaterThanOrEqualTo: doughnutChart.bottomAnchor).isActive = true
|
||||
|
||||
let doughnutBottomAnchor = bottomAnchor.constraint(equalTo: doughnutChart.bottomAnchor)
|
||||
|
||||
@ -26,7 +26,7 @@ import Foundation
|
||||
let list = try typeContainer.decodeMolecules(codingKey: .list)
|
||||
var models: [MoleculeStackItemModel] = []
|
||||
for (index, molecule) in list.enumerated() {
|
||||
models.append(MoleculeStackItemModel(with: StringAndMoleculeModel(string: "\(index).", molecule: molecule)))
|
||||
models.append(MoleculeStackItemModel(with: StringAndMoleculeModel(string: "\(index+1).", molecule: molecule)))
|
||||
}
|
||||
super.init(molecules: models)
|
||||
spacing = 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user