primitive generator: added support for multiple spaces before primitive numbers, add "Hi-Res" to the names of 48/ primitives

Tue, 30 Jul 2013 21:22:47 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 30 Jul 2013 21:22:47 +0300
changeset 407
c6530cdcd622
parent 406
5371baa17346
child 408
81dc5f6b9c73

primitive generator: added support for multiple spaces before primitive numbers, add "Hi-Res" to the names of 48/ primitives

src/primitives.cpp file | annotate | diff | comparison | revisions
--- a/src/primitives.cpp	Tue Jul 30 18:01:53 2013 +0300
+++ b/src/primitives.cpp	Tue Jul 30 21:22:47 2013 +0300
@@ -518,11 +518,19 @@
 	if (frac.indexOf (".") == -1)
 		frac += ".0";
 	
-	if (type == Ring || type == Cone)
-		descr = fmt ("%1 %2 x %3", primitiveTypeName (type), num, frac);
-	else
+	if (type == Ring || type == Cone) {
+		str spacing =
+			( num < 10  ) ? "  " :
+			( num < 100 ) ? " "  : "";
+		
+		descr = fmt ("%1 %2%3 x %4", primitiveTypeName (type), spacing, num, frac);
+	} else
 		descr = fmt ("%1 %2", primitiveTypeName (type), frac);
 	
+	// Prepend "Hi-Res" if 48/ primitive.
+	if( divs == hires )
+		descr.insert( 0, "Hi-Res " );
+	
 	LDOpenFile* f = new LDOpenFile;
 	f->setName (QFileDialog::getSaveFileName (null, QObject::tr ("Save Primitive"), name));
 	

mercurial