fix min color width to 1 (prevent div by 0)

This commit is contained in:
Christopher Lackner 2023-09-19 15:49:27 +02:00
parent c31ae245b1
commit 1855b2cfa7

View File

@ -904,7 +904,7 @@ namespace netgen
data.Append(cf);
}
int n = data.Size()/4;
colors.width = min2(n, 1024);
colors.width = max2(1,min2(n, 1024));
colors.height = (n+colors.width-1)/colors.width;
for([[maybe_unused]] auto i: Range(n, colors.width*colors.height))
data.Append({0.0f, 0.0f, 0.0f, 0.0f});