Fix view order

This commit is contained in:
Ali 2022-12-30 17:19:53 +04:00
parent 012131397e
commit 3566377d68

View File

@ -1606,8 +1606,12 @@ final class StorageUsageScreenComponent: Component {
) )
if let chartTotalLabelView = self.chartTotalLabel.view { if let chartTotalLabelView = self.chartTotalLabel.view {
if chartTotalLabelView.superview == nil { if chartTotalLabelView.superview == nil {
if let pieChartComponentView = self.pieChartView.view {
self.scrollView.insertSubview(chartTotalLabelView, belowSubview: pieChartComponentView)
} else {
self.scrollView.addSubview(chartTotalLabelView) self.scrollView.addSubview(chartTotalLabelView)
} }
}
let totalLabelFrame = CGRect(origin: CGPoint(x: pieChartFrame.minX + floor((pieChartFrame.width - chartTotalLabelSize.width) / 2.0), y: pieChartFrame.minY + floor((pieChartFrame.height - chartTotalLabelSize.height) / 2.0)), size: chartTotalLabelSize) let totalLabelFrame = CGRect(origin: CGPoint(x: pieChartFrame.minX + floor((pieChartFrame.width - chartTotalLabelSize.width) / 2.0), y: pieChartFrame.minY + floor((pieChartFrame.height - chartTotalLabelSize.height) / 2.0)), size: chartTotalLabelSize)
transition.setFrame(view: chartTotalLabelView, frame: totalLabelFrame) transition.setFrame(view: chartTotalLabelView, frame: totalLabelFrame)
transition.setAlpha(view: chartTotalLabelView, alpha: listCategories.isEmpty ? 0.0 : 1.0) transition.setAlpha(view: chartTotalLabelView, alpha: listCategories.isEmpty ? 0.0 : 1.0)