diff -r c7241f504117 -r 6d95c1a41e6e src/gl/gridprogram.cpp --- a/src/gl/gridprogram.cpp Mon Jun 13 02:18:25 2022 +0300 +++ b/src/gl/gridprogram.cpp Tue Jun 14 17:55:50 2022 +0300 @@ -68,7 +68,10 @@ void GridLayer::setGridMatrix(const glm::mat4& newGridMatrix) { - this->shader.setUniformMatrix("grid", newGridMatrix); + this->gridMatrix = newGridMatrix; + if (this->isInitialized) { + this->shader.setUniformMatrix("grid", newGridMatrix); + } } void GridLayer::setGridColor(const QColor& newGridColor) @@ -97,7 +100,7 @@ this->isInitialized = true; constexpr auto data = calcGridData<50>(); this->shader.setUniformVector("gridColor", this->gridColor); - this->setGridMatrix({{1, 0, 0, 0}, {0, 0, 1, 0}, {0, 1, 0, 0}, {0, 0, 0, 1}}); + this->setGridMatrix(this->gridMatrix); this->shader.bufferData(data.data(), data.size(), sizeof data[0]); }