src/gl/gridprogram.cpp

changeset 243
959469a7e149
parent 217
6d95c1a41e6e
child 250
2837b549e616
--- a/src/gl/gridprogram.cpp	Mon Jun 20 22:22:15 2022 +0300
+++ b/src/gl/gridprogram.cpp	Mon Jun 20 22:40:31 2022 +0300
@@ -17,6 +17,7 @@
  */
 
 #include "gridprogram.h"
+#include "partrenderer.h"
 
 constexpr char vertexShaderSource[] = R"(
 #version 330 core
@@ -82,6 +83,11 @@
 	}
 }
 
+void GridLayer::settingsChanged()
+{
+	this->setGridColor(this->renderer->isDark() ? Qt::white : Qt::black);
+}
+
 void GridLayer::initializeGL()
 {
 	this->shader.initialize(
@@ -101,6 +107,7 @@
 	constexpr auto data = calcGridData<50>();
 	this->shader.setUniformVector("gridColor", this->gridColor);
 	this->setGridMatrix(this->gridMatrix);
+	this->settingsChanged();
 	this->shader.bufferData(data.data(), data.size(), sizeof data[0]);
 }
 

mercurial