Skip to content

Commit 336965d

Browse files
committed
修正插件项目资源占用图可能会超出范围的问题
1 parent 2e1b1a1 commit 336965d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

TrafficMonitor/TaskBarDlg.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,11 @@ void CTaskBarDlg::DisableRenderFeatureIfNecessary(CSupportedRenderEnums& ref_sup
509509

510510
void CTaskBarDlg::TryDrawStatusBar(IDrawCommon& drawer, const CRect& rect_bar, int usage_percent)
511511
{
512+
//限制范围
513+
if (usage_percent > 100)
514+
usage_percent = 100;
515+
if (usage_percent < 0)
516+
usage_percent = 0;
512517
COLORREF graph_color = theApp.m_taskbar_data.GetUsageGraphColor();
513518
CSize fill_size = CSize(rect_bar.Width() * usage_percent / 100, rect_bar.Height());
514519
CRect rect_fill(rect_bar.TopLeft(), fill_size);

0 commit comments

Comments
 (0)