Skip to content

Commit 262f826

Browse files
committed
refactor(partition): simplify redundant condition in chart drawing
Remove redundant `else if (m_sumValue >= 100)` condition check, simplify to `else` since the preceding `if` already covers the complementary case. 简化分区图表绘制中冗余的条件判断,将 else if 简化为 else。 Log: 简化分区图表绘制冗余条件 PMS: https://pms.uniontech.com/bug-view-354861.html Influence: 仅代码逻辑简化,不影响功能行为。
1 parent 122cbf2 commit 262f826

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

application/widgets/customcontrol/partchartshowing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ void PartChartShowing::addPaint(QPainter *painter)
237237
}
238238
m_flag = 0;
239239
}
240-
} else if (m_sumValue >= 100) { //绘制最后一个分区当超过整个分区容量的时候以及选中状态
240+
} else { //绘制最后一个分区当超过整个分区容量的时候以及选中状态
241241
// qDebug() << "sumvalue" << sumvalue;
242242
double width = ((m_partSize.at(m_partSize.size() - 2) / m_total)) * (paintRect.width() - RADIUS) - RIGHTSPACE;
243243
if (m_partSize.at(m_partSize.size() - 2) / m_total < 0.01) {

0 commit comments

Comments
 (0)