[Gtkradiant] r4809 - GtkRadiant/trunk/radiant

svn-noreply at zerowing.idsoftware.com svn-noreply at zerowing.idsoftware.com
Sun Sep 26 05:39:00 CDT 2004


Author: spog
Date: 2004-09-26 05:38:53 -0500 (Sun, 26 Sep 2004)
New Revision: 4809

Modified:
   GtkRadiant/trunk/radiant/surfacedialog.cpp
Log:
textool rotation fix

Modified: GtkRadiant/trunk/radiant/surfacedialog.cpp
===================================================================
--- GtkRadiant/trunk/radiant/surfacedialog.cpp	2004-09-26 01:37:57 UTC (rev 4808)
+++ GtkRadiant/trunk/radiant/surfacedialog.cpp	2004-09-26 10:38:53 UTC (rev 4809)
@@ -1240,8 +1240,8 @@
 #define DEG_TO_RAD	(3.14159265358979 / 180.0)
 bool lButtonDown = false;
 bool rButtonDown = false;
-int dragPoint;
-int anchorPoint;
+//int dragPoint;
+//int anchorPoint;
 bool haveAnchor = false;
 brushprimit_texdef_t origBP;					// Original brush primitive (before we muck it up)
 float controlRadius = 5.0f;
@@ -1752,6 +1752,7 @@
 
 Vector2 trans;
 Vector2 trans2;
+Vector2 dragPoint;	// Defined in terms of window space (+x/-y)
 Vector2 oldTrans;
 gboolean Textool_button_press(GtkWidget * win, GdkEventButton * e, gpointer)
 {
@@ -1771,7 +1772,7 @@
 		trans.x() = -tm.coords[0][0] * nx - tm.coords[0][1] * ny;
 		trans.y() = -tm.coords[1][0] * nx - tm.coords[1][1] * ny;
 
-//		trans2.x() = e->x, trans2.y() = e->y;
+		dragPoint.x() = e->x, dragPoint.y() = e->y;
 		trans2.x() = nx, trans2.y() = ny;
 		oldRotationAngle = rotationAngle;
 //		oldTrans.x() = tm.coords[0][2] - nx * textureSize.x();
@@ -1882,7 +1883,7 @@
 			// Shamus: New rotate code
 			int cx = (int)(windowSize.x() * (center.x() - extents.minX) / extents.width());
 			int cy = (int)(windowSize.y() * (center.y() - extents.minY) / extents.height());
-			Vector3 v1(trans2.x() - cx, trans2.y() - cy, 0), v2(e->x - cx, e->y - cy, 0);
+			Vector3 v1(dragPoint.x() - cx, dragPoint.y() - cy, 0), v2(e->x - cx, e->y - cy, 0);
 
 			vector3_normalise(v1);
 			vector3_normalise(v2);
@@ -1902,6 +1903,7 @@
 if (cross[2] < 0)
 	rotationAngle = -rotationAngle;
 
+//NO! DOESN'T WORK! rotationAngle -= 45.0f * DEG_TO_RAD;
 //Let's try this:
 //No wok.
 /*c = cos(rotationAngle - oldRotationAngle);




More information about the Gtkradiant mailing list