r17369 by jghali - remove unnecessary indentation level in ScPainter setupPolygon()

scribus-commit scribus-commit at lists.scribus.net
Sat Mar 10 14:23:55 UTC 2012


Author: jghali
Date: Sat Mar 10 14:23:55 2012
New Revision: 17369

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17369
Log:
remove unnecessary indentation level in ScPainter setupPolygon()

Modified:
    trunk/Scribus/scribus/scpainter.cpp

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17369&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Sat Mar 10 14:23:55 2012
@@ -652,7 +652,7 @@
 
 void ScPainter::fillPath()
 {
-	if( fillMode != 0)
+	if (fillMode != 0)
 		fillPathHelper();
 }
 
@@ -1803,44 +1803,43 @@
 	bool nPath = true;
 	bool first = true;
 	FPoint np, np1, np2, np3, np4, firstP;
-	if (points->size() > 3)
+
+	if (points->size() <= 3)
+		return;
+
+	newPath();
+	for (uint poi=0; poi<points->size()-3; poi += 4)
 	{
-		newPath();
-		for (uint poi=0; poi<points->size()-3; poi += 4)
-		{
-			if (points->point(poi).x() > 900000)
-			{
-				nPath = true;
-				continue;
-			}
-			if (nPath)
-			{
-				np = points->point(poi);
-				if ((!first) && (closed) && (np4 == firstP))
-					cairo_close_path( m_cr );
-    			cairo_move_to( m_cr, np.x(), np.y());
-				firstP = np;
-				nPath = false;
-				first = false;
-				np4 = np;
-			}
+		if (points->point(poi).x() > 900000)
+		{
+			nPath = true;
+			continue;
+		}
+		if (nPath)
+		{
 			np = points->point(poi);
-			np1 = points->point(poi+1);
-			np2 = points->point(poi+3);
-			np3 = points->point(poi+2);
-			if (np4 == np3)
-				continue;
+			if ((!first) && (closed) && (np4 == firstP))
+				cairo_close_path( m_cr );
+			cairo_move_to( m_cr, np.x(), np.y());
+			first = nPath = false;
+			firstP = np4 = np;
+		}
+		np  = points->point(poi);
+		np1 = points->point(poi + 1);
+		np2 = points->point(poi + 3);
+		np3 = points->point(poi + 2);
+		if (np4 == np3)
+			continue;
 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 9, 6)
-			if ((np == np1) && (np2 == np3))
-				cairo_line_to( m_cr, np3.x(), np3.y());
-			else
-#endif
-				cairo_curve_to(m_cr, np1.x(), np1.y(), np2.x(), np2.y(), np3.x(), np3.y());
-			np4 = np3;
-		}
-		if (closed)
-    		cairo_close_path( m_cr );
+		if ((np == np1) && (np2 == np3))
+			cairo_line_to( m_cr, np3.x(), np3.y());
+		else
+#endif
+			cairo_curve_to(m_cr, np1.x(), np1.y(), np2.x(), np2.y(), np3.x(), np3.y());
+		np4 = np3;
 	}
+	if (closed)
+		cairo_close_path( m_cr );
 }
 
 void ScPainter::drawPolygon()




More information about the scribus-commit mailing list