added an ini option to disable line stipple

Tue, 03 Apr 2018 18:55:57 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Tue, 03 Apr 2018 18:55:57 +0300
changeset 1376
83dd6cbd7f1a
parent 1375
689121d162b6
child 1377
0b9a946002be

added an ini option to disable line stipple

src/canvas.cpp file | annotate | diff | comparison | revisions
src/configurationoptions.txt file | annotate | diff | comparison | revisions
src/glrenderer.cpp file | annotate | diff | comparison | revisions
--- a/src/canvas.cpp	Tue Apr 03 17:37:33 2018 +0300
+++ b/src/canvas.cpp	Tue Apr 03 18:55:57 2018 +0300
@@ -86,7 +86,10 @@
 	Vertex topLeft = currentCamera().idealize(currentCamera().convert2dTo3d({0, 0}));
 	Vertex bottomRight = currentCamera().idealize(currentCamera().convert2dTo3d({width(), height()}));
 	qreal gridSize = grid()->coordinateSnap();
-	glEnable(GL_LINE_STIPPLE);
+
+	if (config::useLineStipple())
+		glEnable(GL_LINE_STIPPLE);
+
 	glBegin(GL_LINES);
 
 	switch (grid()->type())
--- a/src/configurationoptions.txt	Tue Apr 03 17:37:33 2018 +0300
+++ b/src/configurationoptions.txt	Tue Apr 03 18:55:57 2018 +0300
@@ -71,6 +71,7 @@
 option MainWindowState = QByteArray {}
 option MainWindowGeometry = QByteArray {}
 option MainSplitterState = QByteArray {}
+option UseLineStipple = true
 
 # File management options
 option Libraries = QVector<Library> {}
--- a/src/glrenderer.cpp	Tue Apr 03 17:37:33 2018 +0300
+++ b/src/glrenderer.cpp	Tue Apr 03 18:55:57 2018 +0300
@@ -435,7 +435,10 @@
 		}
 
 		drawVbos (VboClass::Lines, VboSubclass::RegularColors);
-		glEnable (GL_LINE_STIPPLE);
+
+		if (config::useLineStipple())
+			glEnable (GL_LINE_STIPPLE);
+
 		drawVbos (VboClass::ConditionalLines, VboSubclass::RegularColors);
 		glDisable (GL_LINE_STIPPLE);
 

mercurial