r16787 by fschmid - Fixed incorrect position of the focal point when editing conical gradients.

scribus-commit scribus-commit at lists.scribus.net
Mon Aug 15 21:07:22 UTC 2011


Author: fschmid
Date: Mon Aug 15 21:07:22 2011
New Revision: 16787

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16787
Log:
Fixed incorrect position of the focal point when editing conical gradients.

Modified:
    trunk/Scribus/scribus/pageitem.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16787&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Mon Aug 15 21:07:22 2011
@@ -3077,6 +3077,14 @@
 	path = mr.map(path);
 	arcPath.fromQPainterPath(path);
 	arcPath.translate(GrStartX, GrStartY);
+	QPointF foc = QPointF(GrFocalX, GrFocalY);
+	QTransform qmatrix;
+	qmatrix.translate(GrStartX, GrStartY);
+	qmatrix.rotate(-startAngle);
+	qmatrix.translate(0, GrStartY * (1.0 - GrScale));
+	qmatrix.translate(-GrStartX, -GrStartY);
+	qmatrix.scale(1, GrScale);
+	foc = qmatrix.map(foc);
 	mgP1.resetTo(arcPath.point(0));
 	mgP1.controlRight = arcPath.point(1);
 	mgP1.transparency = rstops.at(0)->opacity;
@@ -3094,7 +3102,7 @@
 	mgP2.color = rstops.at(1)->color;
 	mgP2.color.setAlphaF(mgP2.transparency);
 
-	mgP3.resetTo(FPoint(GrFocalX, GrFocalY));
+	mgP3.resetTo(FPoint(foc.x(), foc.y()));
 	mgP3.transparency = rstops.at(0)->opacity;
 	mgP3.shade = rstops.at(0)->shade;
 	mgP3.colorName = rstops.at(0)->name;




More information about the scribus-commit mailing list