r23753 by jghali - Code style fixes

scribus-commit scribus-commit at lists.scribus.net
Sun May 10 22:20:51 UTC 2020


Author: jghali
Date: Sun May 10 22:20:50 2020
New Revision: 23753

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23753
Log:
Code style fixes

Modified:
    trunk/Scribus/scribus/pageitem_osgframe.cpp

Modified: trunk/Scribus/scribus/pageitem_osgframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23753&path=/trunk/Scribus/scribus/pageitem_osgframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_osgframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_osgframe.cpp	Sun May 10 22:20:50 2020
@@ -141,7 +141,7 @@
 	currentView = tr("Default");
 	loadedModel = nullptr;
 	distanceToObj = 0.0;
-	modelFile = "";
+	modelFile.clear();
 	PageItem_ImageFrame::clearContents();
 }
 
@@ -167,19 +167,19 @@
 
 double PageItem_OSGFrame::getDistance(osg::Vec3d pos1, osg::Vec3d pos2)
 {
-	double dist2D = sqrt((pos1[0]-pos2[0])*(pos1[0]-pos2[0]) + (pos1[1]-pos2[1])*(pos1[1]-pos2[1]));
-	return sqrt(dist2D*dist2D + (pos1[2]-pos2[2])*(pos1[2]-pos2[2]));
+	double dist2D = sqrt((pos1[0] - pos2[0]) * (pos1[0] - pos2[0]) + (pos1[1] - pos2[1]) * (pos1[1] - pos2[1]));
+	return sqrt(dist2D * dist2D + (pos1[2] - pos2[2]) * (pos1[2] - pos2[2]));
 }
 
 #define normalized(x, y, z)		\
 {					\
 	double modulo;			\
-	modulo = sqrtf(x*x + y*y + z*z);	\
+	modulo = sqrtf(x * x + y * y + z * z);	\
 	if (modulo != 0.0)			\
 	{					\
-		x = x/modulo;			\
-		y = y/modulo;			\
-		z = z/modulo;			\
+		x = x / modulo;			\
+		y = y / modulo;			\
+		z = z / modulo;			\
 	}					\
 }
 
@@ -226,9 +226,9 @@
 		upx = cameraUp[0];
 		upy = cameraUp[1];
 		upz = cameraUp[2];
-		leftx = viewz*upy - viewy*upz;
-		lefty = viewx*upz - viewz*upx;
-		leftz = viewy*upx - viewx*upy;
+		leftx = viewz * upy - viewy * upz;
+		lefty = viewx * upz - viewz * upx;
+		leftz = viewy * upx - viewx * upy;
 		normalized(leftx, lefty, leftz);
 	}
 	/* apply camera roll*/
@@ -236,14 +236,14 @@
 		double leftxprime, leftyprime, leftzprime;
 		double upxprime, upyprime, upzprime;
 		double sinroll, cosroll;
-		sinroll =  sin((roll/180.0f)*M_PI);
-		cosroll =  cos((roll/180.0f)*M_PI);
-		leftxprime = leftx*cosroll + upx*sinroll;
-		leftyprime = lefty*cosroll + upy*sinroll;
-		leftzprime = leftz*cosroll + upz*sinroll;
-		upxprime = upx*cosroll + leftx*sinroll;
-		upyprime = upy*cosroll + lefty*sinroll;
-		upzprime = upz*cosroll + leftz*sinroll;
+		sinroll =  sin((roll / 180.0f) * M_PI);
+		cosroll =  cos((roll / 180.0f) * M_PI);
+		leftxprime = leftx * cosroll + upx * sinroll;
+		leftyprime = lefty * cosroll + upy * sinroll;
+		leftzprime = leftz * cosroll + upz * sinroll;
+		upxprime = upx * cosroll + leftx * sinroll;
+		upyprime = upy * cosroll + lefty * sinroll;
+		upzprime = upz * cosroll + leftz * sinroll;
 		leftx = leftxprime;
 		lefty = leftyprime;
 		leftz = leftzprime;
@@ -257,9 +257,9 @@
 	{
 		roo = 0.000000000000000001;
 	}
-	transx = trackerCenter[0] - roo*viewx;
-	transy = trackerCenter[1] - roo*viewy;
-	transz = trackerCenter[2] - roo*viewz;
+	transx = trackerCenter[0] - roo * viewx;
+	transy = trackerCenter[1] - roo * viewy;
+	transz = trackerCenter[2] - roo * viewz;
 	if (fabs(leftx) < 0.0000001)
 		leftx = 0.0;
 	if (fabs(lefty) < 0.0000001)




More information about the scribus-commit mailing list