remove leading whitespace from comments when drawing them in the list

Fri, 15 Mar 2013 22:27:38 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Fri, 15 Mar 2013 22:27:38 +0200
changeset 10
5b0579997e9b
parent 9
2467f92d3473
child 11
323390a03294

remove leading whitespace from comments when drawing them in the list

gui.cpp file | annotate | diff | comparison | revisions
--- a/gui.cpp	Fri Mar 15 22:13:36 2013 +0200
+++ b/gui.cpp	Fri Mar 15 22:27:38 2013 +0200
@@ -312,6 +312,10 @@
 		switch (obj->getType ()) {
 		case OBJ_Comment:
 			zText = static_cast<LDComment*> (obj)->zText;
+			
+			// Remove leading whitespace
+			while (~zText && zText[0] == ' ')
+				zText -= -1;
 			break;
 		
 		case OBJ_Empty:
@@ -340,7 +344,7 @@
 		case OBJ_Quad:
 			{
 				LDQuad* quad = static_cast<LDQuad*> (obj);
-				zText.format ("%s, %s, %s",
+				zText.format ("%s, %s, %s, %s",
 					quad->vaCoords[0].getStringRep ().chars(),
 					quad->vaCoords[1].getStringRep ().chars(),
 					quad->vaCoords[2].getStringRep ().chars(),

mercurial