1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-08 22:26:51 +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,6 +483,8 @@ LineChart::LineChart(Rect position, std::string title, TData data, TIcons icons,
// draw grid (vertical lines) // draw grid (vertical lines)
int dayGridInterval = maxDay < 700 ? 7 : 28; int dayGridInterval = maxDay < 700 ? 7 : 28;
if(maxDay > 1)
{
for(const auto & line : data) for(const auto & line : data)
{ {
for(int i = 0; i < line.second.size(); i += dayGridInterval) for(int i = 0; i < line.second.size(); i += dayGridInterval)
@ -491,6 +493,7 @@ LineChart::LineChart(Rect position, std::string title, TData data, TIcons icons,
canvas->addLine(Point(p.x, chartArea.topLeft().y), Point(p.x, chartArea.topLeft().y + chartArea.h), ColorRGBA(70, 70, 70)); canvas->addLine(Point(p.x, chartArea.topLeft().y), Point(p.x, chartArea.topLeft().y + chartArea.h), ColorRGBA(70, 70, 70));
} }
} }
}
// draw grid (horizontal lines) // draw grid (horizontal lines)
if(maxVal > 0) if(maxVal > 0)