浏览代码

remove weird line when winning in the first round

Laserlicht 8 月之前
父节点
当前提交
f8cebe81bf
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      client/mainmenu/CStatisticScreen.cpp

+ 7 - 4
client/mainmenu/CStatisticScreen.cpp

@@ -483,12 +483,15 @@ LineChart::LineChart(Rect position, std::string title, TData data, TIcons icons,
 
 	// draw grid (vertical lines)
 	int dayGridInterval = maxDay < 700 ? 7 : 28;
-	for(const auto & line : data)
+	if(maxDay > 1)
 	{
-		for(int i = 0; i < line.second.size(); i += dayGridInterval)
+		for(const auto & line : data)
 		{
-			Point p = getPoint(i, line.second) + chartArea.topLeft();
-			canvas->addLine(Point(p.x, chartArea.topLeft().y), Point(p.x, chartArea.topLeft().y + chartArea.h), ColorRGBA(70, 70, 70));
+			for(int i = 0; i < line.second.size(); i += dayGridInterval)
+			{
+				Point p = getPoint(i, line.second) + chartArea.topLeft();
+				canvas->addLine(Point(p.x, chartArea.topLeft().y), Point(p.x, chartArea.topLeft().y + chartArea.h), ColorRGBA(70, 70, 70));
+			}
 		}
 	}