Rotate subfiles and radials by their origin and not by their contents' bboxes.

Sun, 21 Apr 2013 16:46:42 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sun, 21 Apr 2013 16:46:42 +0300
changeset 122
33c227d0fa1b
parent 121
7e87c85ad092
child 123
a54d9d5c0c1f

Rotate subfiles and radials by their origin and not by their contents' bboxes.

gui_editactions.cpp file | annotate | diff | comparison | revisions
--- a/gui_editactions.cpp	Sun Apr 21 16:36:20 2013 +0300
+++ b/gui_editactions.cpp	Sun Apr 21 16:46:42 2013 +0300
@@ -592,11 +592,16 @@
 	);
 	
 	// Calculate center vertex
-	for (LDObject* obj : sel)
-		box << obj;
+	for (LDObject* obj : sel) {
+		if (obj->getType () == OBJ_Subfile)
+			box << static_cast<LDSubfile*> (obj)->vPosition;
+		else if (obj->getType () == OBJ_Radial)
+			box << static_cast<LDRadial*> (obj)->vPosition;
+		else
+			box << obj;
+	}
 	
 	origin = box.center ();
-	printf ("origin: %s\n", origin.getStringRep (true).chars ());
 	
 	// Apply the above matrix to everything
 	for (LDObject* obj : sel) {
@@ -612,7 +617,7 @@
 			LDRadial* rad = static_cast<LDRadial*> (obj);
 			
 			queue.push_back (&rad->vPosition);
-			// rad->mMatrix = rad->mMatrix * transform;
+			rad->mMatrix = rad->mMatrix * transform;
 		} else if (obj->getType () == OBJ_Vertex)
 			queue.push_back (&static_cast<LDVertex*> (obj)->vPosition);
 	}

mercurial