1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-11 14:49:23 +02:00

remove weird line when winning in the first round

This commit is contained in:
Laserlicht 2025-02-22 12:19:31 +01:00
parent ad68773f81
commit f8cebe81bf

View File

@ -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));
}
}
}