r15839 by fschmid - - Removed some more no longer needed files from the build

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 11 23:47:45 CET 2010


Author: fschmid
Date: Thu Nov 11 22:47:45 2010
New Revision: 15839

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15839
Log:
- Removed some more no longer needed files from the build
- Fixed zoom buttons in the status bar not working correctly
- Fixed incorrect display when editing gradient vectors.

Modified:
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/canvas.h
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/canvasmode_editgradient.cpp
    trunk/Scribus/scribus/canvasmode_editgradient.h
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/scribusview.h

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15839&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Thu Nov 11 22:47:45 2010
@@ -148,7 +148,7 @@
   ui/helpbrowsernavigation.ui
   ui/unicodesearch.ui
   ui/useprintermarginsdialog.ui
-  ${SCRIBUS_ITEMSETTERS_UI_SRC}
+#  ${SCRIBUS_ITEMSETTERS_UI_SRC}
   ${SCRIBUS_OSG_UI_SRC}
 )
 
@@ -173,7 +173,7 @@
   canvasgesture_rulermove.h
   canvasmode.h
   canvasmode_edit.h
-  canvasmode_legacy.h
+#  canvasmode_legacy.h
   canvasmode_measurements.h
   canvasmode_normal.h
   ui/charselect.h
@@ -419,7 +419,7 @@
   urllauncher.h
   ui/useprintermarginsdialog.h
   ui/vruler.h
-  ${SCRIBUS_ITEMSETTERS_CLASS}
+#  ${SCRIBUS_ITEMSETTERS_CLASS}
   ${SCRIBUS_OSG_CLASS}
 )
 
@@ -457,7 +457,7 @@
   canvasmode_edit.cpp
   canvasmode_editgradient.cpp
   canvasmode_editmeshgradient.cpp
-  canvasmode_legacy.cpp
+#  canvasmode_legacy.cpp
   canvasmode_magnifier.cpp
   canvasmode_measurements.cpp
   canvasmode_nodeedit.cpp
@@ -821,7 +821,7 @@
   vgradient.cpp
   vgradientex.cpp
   ui/vruler.cpp
-  ${SCRIBUS_ITEMSETTERS_SRC}
+#  ${SCRIBUS_ITEMSETTERS_SRC}
   ${SCRIBUS_OSG_SRC}
   ${SCRIBUS_GMAGICK_SRC}
 )

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15839&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Thu Nov 11 22:47:45 2010
@@ -1041,10 +1041,6 @@
 	{
 		drawControlsDrawLine(psx);
 	}
-	if (m_doc->appMode == modeEditGradientVectors)
-	{
-		drawControlsGradientVectors(psx, m_doc->m_Selection->itemAt(0));
-	}
 	if (m_viewMode.operItemMoving || m_viewMode.operItemResizing)
 	{
 		if (m_viewMode.operItemResizing)
@@ -1104,12 +1100,7 @@
 			for (uint cu = 0; cu < selectedItemCount; cu++)
 			{
 				currItem = m_doc->m_Selection->itemAt(cu);
-//				pp->resetMatrix();
-//				QPoint out = contentsToViewport(QPoint(0, 0));
-//				pp->translate(out.x(), out.y());
-//				pp->translate(-qRound(m_doc->minCanvasCoordinate.x()*m_viewMode.scale), -qRound(m_doc->minCanvasCoordinate.y()*m_viewMode.scale));
 				pp->save();
-//				Transform(currItem, pp);
 				pp->translate(currItem->xPos(), currItem->yPos());
 				pp->rotate(currItem->rotation());							
 				pp->setBrush(Qt::NoBrush);
@@ -1159,184 +1150,9 @@
 			m_doc->m_Selection->setGroupRect();
 			m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 			QPoint out = contentsToViewport(QPoint(0, 0));
-//			pp->resetMatrix();
-//			pp->translate(out.x(), out.y());
-//			pp->translate(-qRound(m_doc->minCanvasCoordinate.x()*m_viewMode.scale), -qRound(m_doc->minCanvasCoordinate.y()*m_viewMode.scale));
-//			pp->scale(m_viewMode.scale, m_viewMode.scale);
 			pp->translate(gx, gy);
 			pp->drawRect(QRectF(0.0, 0.0, gw, gh));
 		}
-	}
-}
-
-
-/**
- 
-void Canvas::drawControlsHighlightRect(QPainter* pp)
-{
-	QColor drawColor = qApp->palette().color(QPalette::Active, QPalette::Highlight);
-	pp->setPen(QPen(drawColor, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
-	drawColor.setAlpha(64);
-//	pp->resetMatrix();
-//	QPoint out = contentsToViewport(QPoint(0, 0));
-//	pp->translate(out.x(), out.y());
-//	pp->translate(-qRound(m_doc->minCanvasCoordinate.x()*m_viewMode.scale), -qRound(m_doc->minCanvasCoordinate.y()*m_viewMode.scale));
-	pp->setBrush(drawColor);
-	pp->drawPolygon(m_viewMode.redrawPolygon);
-	m_viewMode.redrawPolygon.clear();
-}
-*/
-
-
-/**
- */
-void Canvas::drawControlsGradientVectors(QPainter* psx, PageItem *currItem)
-{
-//	psx->resetMatrix();
-//	QPoint out = contentsToViewport(QPoint(0, 0));
-//	psx->translate(out.x(), out.y());
-//	psx->translate(-qRound(m_doc->minCanvasCoordinate.x()*m_viewMode.scale), -qRound(m_doc->minCanvasCoordinate.y()*m_viewMode.scale));
-	//Transform(currItem, psx);
-	psx->translate(static_cast<int>(currItem->xPos()), static_cast<int>(currItem->yPos()));
-	psx->rotate(currItem->rotation());
-	psx->setPen(QPen(Qt::blue, 1.0 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
-	psx->setBrush(Qt::NoBrush);
-	if (m_view->editStrokeGradient == 1)
-	{
-		psx->drawLine(QPointF(currItem->GrStrokeStartX, currItem->GrStrokeStartY), QPointF(currItem->GrStrokeEndX, currItem->GrStrokeEndY));
-		psx->setPen(QPen(Qt::magenta, 8.0 / m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
-		psx->drawPoint(QPointF(currItem->GrStrokeStartX, currItem->GrStrokeStartY));
-		psx->drawPoint(QPointF(currItem->GrStrokeEndX, currItem->GrStrokeEndY));
-		double radEnd = distance(currItem->GrStrokeEndX - currItem->GrStrokeStartX, currItem->GrStrokeEndY - currItem->GrStrokeStartY);
-		double rotEnd = xy2Deg(currItem->GrStrokeEndX - currItem->GrStrokeStartX, currItem->GrStrokeEndY - currItem->GrStrokeStartY);
-		QTransform qmatrix;
-		qmatrix.translate(currItem->GrStrokeStartX, currItem->GrStrokeStartY);
-		qmatrix.rotate(rotEnd);
-		double mask_gradientSkew = 0.0;
-		if (currItem->GrStrokeSkew == 90)
-			mask_gradientSkew = 1;
-		else if (currItem->GrStrokeSkew == 180)
-			mask_gradientSkew = 0;
-		else if (currItem->GrStrokeSkew == 270)
-			mask_gradientSkew = -1;
-		else if (currItem->GrStrokeSkew == 390)
-			mask_gradientSkew = 0;
-		else
-			mask_gradientSkew = tan(M_PI / 180.0 * currItem->GrStrokeSkew);
-		qmatrix.shear(mask_gradientSkew, 0);
-		qmatrix.translate(0, currItem->GrStrokeStartY * (1.0 - currItem->GrStrokeScale));
-		qmatrix.translate(-currItem->GrStrokeStartX, -currItem->GrStrokeStartY);
-		qmatrix.scale(1, currItem->GrStrokeScale);
-		if (currItem->GrTypeStroke == 7)
-			psx->drawPoint(qmatrix.map(QPointF(currItem->GrStrokeFocalX, currItem->GrStrokeFocalY)));
-		QTransform m;
-		m.translate(currItem->GrStrokeStartX, currItem->GrStrokeStartY);
-		m.rotate(rotEnd);
-		m.rotate(-90);
-		m.rotate(currItem->GrStrokeSkew);
-		m.translate(radEnd * currItem->GrStrokeScale, 0);
-		QPointF shP = m.map(QPointF(0,0));
-		psx->setPen(QPen(Qt::blue, 1.0 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
-		psx->drawLine(QPointF(currItem->GrStrokeStartX, currItem->GrStrokeStartY), shP);
-		psx->setPen(QPen(Qt::magenta, 8.0 / m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
-		psx->drawPoint(shP);
-	}
-	else if (m_view->editStrokeGradient == 2)
-	{
-		psx->drawLine(QPointF(currItem->GrMaskStartX, currItem->GrMaskStartY), QPointF(currItem->GrMaskEndX, currItem->GrMaskEndY));
-		psx->setPen(QPen(Qt::magenta, 8.0 / m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
-		psx->drawPoint(QPointF(currItem->GrMaskStartX, currItem->GrMaskStartY));
-		psx->drawPoint(QPointF(currItem->GrMaskEndX, currItem->GrMaskEndY));
-		double radEnd = distance(currItem->GrMaskEndX - currItem->GrMaskStartX, currItem->GrMaskEndY - currItem->GrMaskStartY);
-		double rotEnd = xy2Deg(currItem->GrMaskEndX - currItem->GrMaskStartX, currItem->GrMaskEndY - currItem->GrMaskStartY);
-		QTransform qmatrix;
-		qmatrix.translate(currItem->GrMaskStartX, currItem->GrMaskStartY);
-		qmatrix.rotate(rotEnd);
-		double mask_gradientSkew = 0.0;
-		if (currItem->GrMaskSkew == 90)
-			mask_gradientSkew = 1;
-		else if (currItem->GrMaskSkew == 180)
-			mask_gradientSkew = 0;
-		else if (currItem->GrMaskSkew == 270)
-			mask_gradientSkew = -1;
-		else if (currItem->GrMaskSkew == 390)
-			mask_gradientSkew = 0;
-		else
-			mask_gradientSkew = tan(M_PI / 180.0 * currItem->GrMaskSkew);
-		qmatrix.shear(mask_gradientSkew, 0);
-		qmatrix.translate(0, currItem->GrMaskStartY * (1.0 - currItem->GrMaskScale));
-		qmatrix.translate(-currItem->GrMaskStartX, -currItem->GrMaskStartY);
-		qmatrix.scale(1, currItem->GrMaskScale);
-		if ((currItem->GrMask == 2) || (currItem->GrMask == 5))
-			psx->drawPoint(qmatrix.map(QPointF(currItem->GrMaskFocalX, currItem->GrMaskFocalY)));
-		QTransform m;
-		m.translate(currItem->GrMaskStartX, currItem->GrMaskStartY);
-		m.rotate(rotEnd);
-		m.rotate(-90);
-		m.rotate(currItem->GrMaskSkew);
-		m.translate(radEnd * currItem->GrMaskScale, 0);
-		QPointF shP = m.map(QPointF(0,0));
-		psx->setPen(QPen(Qt::blue, 1.0 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
-		psx->drawLine(QPointF(currItem->GrMaskStartX, currItem->GrMaskStartY), shP);
-		psx->setPen(QPen(Qt::magenta, 8.0 / m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
-		psx->drawPoint(shP);
-	}
-	else if (m_view->editStrokeGradient == 0)
-	{
-		psx->drawLine(QPointF(currItem->GrStartX, currItem->GrStartY), QPointF(currItem->GrEndX, currItem->GrEndY));
-		psx->setPen(QPen(Qt::magenta, 8.0 / m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
-		psx->drawPoint(QPointF(currItem->GrStartX, currItem->GrStartY));
-		psx->drawPoint(QPointF(currItem->GrEndX, currItem->GrEndY));
-		double radEnd = distance(currItem->GrEndX - currItem->GrStartX, currItem->GrEndY - currItem->GrStartY);
-		double rotEnd = xy2Deg(currItem->GrEndX - currItem->GrStartX, currItem->GrEndY - currItem->GrStartY);
-		QTransform qmatrix;
-		qmatrix.translate(currItem->GrStartX, currItem->GrStartY);
-		qmatrix.rotate(rotEnd);
-		double mask_gradientSkew = 0.0;
-		if (currItem->GrSkew == 90)
-			mask_gradientSkew = 1;
-		else if (currItem->GrSkew == 180)
-			mask_gradientSkew = 0;
-		else if (currItem->GrSkew == 270)
-			mask_gradientSkew = -1;
-		else if (currItem->GrSkew == 390)
-			mask_gradientSkew = 0;
-		else
-			mask_gradientSkew = tan(M_PI / 180.0 * currItem->GrSkew);
-		qmatrix.shear(mask_gradientSkew, 0);
-		qmatrix.translate(0, currItem->GrStartY * (1.0 - currItem->GrScale));
-		qmatrix.translate(-currItem->GrStartX, -currItem->GrStartY);
-		qmatrix.scale(1, currItem->GrScale);
-		if (currItem->GrType == 7)
-			psx->drawPoint(qmatrix.map(QPointF(currItem->GrFocalX, currItem->GrFocalY)));
-		QTransform m;
-		m.translate(currItem->GrStartX, currItem->GrStartY);
-		m.rotate(rotEnd);
-		m.rotate(-90);
-		m.rotate(currItem->GrSkew);
-		m.translate(radEnd * currItem->GrScale, 0);
-		QPointF shP = m.map(QPointF(0,0));
-		psx->setPen(QPen(Qt::blue, 1.0 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
-		psx->drawLine(QPointF(currItem->GrStartX, currItem->GrStartY), shP);
-		psx->setPen(QPen(Qt::magenta, 8.0 / m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
-		psx->drawPoint(shP);
-	}
-	else if (m_view->editStrokeGradient == 3)
-	{
-		psx->setPen(QPen(Qt::magenta, 8.0 / m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
-		psx->drawPoint(QPointF(currItem->GrControl1.x(), currItem->GrControl1.y()));
-		psx->drawPoint(QPointF(currItem->GrControl2.x(), currItem->GrControl2.y()));
-		psx->drawPoint(QPointF(currItem->GrControl3.x(), currItem->GrControl3.y()));
-		psx->drawPoint(QPointF(currItem->GrControl4.x(), currItem->GrControl4.y()));
-	}
-	else if (m_view->editStrokeGradient == 4)
-	{
-		psx->setPen(QPen(Qt::magenta, 8.0 / m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
-		psx->drawPoint(QPointF(currItem->GrControl1.x(), currItem->GrControl1.y()));
-		psx->drawPoint(QPointF(currItem->GrControl2.x(), currItem->GrControl2.y()));
-		psx->drawPoint(QPointF(currItem->GrControl3.x(), currItem->GrControl3.y()));
-		psx->drawPoint(QPointF(currItem->GrControl4.x(), currItem->GrControl4.y()));
-		psx->drawPoint(QPointF(currItem->GrControl5.x(), currItem->GrControl5.y()));
 	}
 }
 
@@ -1392,9 +1208,6 @@
  */
 void Canvas::drawControlsMeasurementLine(QPainter* pp)
 {
-//	pp->resetMatrix();
-//	QPoint out = contentsToViewport(QPoint(0, 0));
-//	pp->translate(out.x(), out.y());
 	pp->setBrush(Qt::NoBrush);
 	pp->setPen(QPen(Qt::black, 1.0, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin));
 	pp->drawPolyline(m_viewMode.redrawPolygon);
@@ -1407,11 +1220,6 @@
  */
 void Canvas::drawControlsDrawLine(QPainter* pp)
 {
-//	QPoint out = contentsToViewport(QPoint(0, 0));
-//	pp->resetMatrix();
-//	pp->translate(out.x(), out.y());
-//	pp->translate(-qRound(m_doc->minCanvasCoordinate.x()*m_viewMode.scale), -qRound(m_doc->minCanvasCoordinate.y()*m_viewMode.scale));
-//	pp->scale(m_viewMode.scale, m_viewMode.scale);
 	pp->setBrush(Qt::NoBrush);
 	pp->setPen(QPen(Qt::black, 1.0 / m_viewMode.scale, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin));
 	pp->drawPolyline(m_viewMode.redrawPolygon);
@@ -1424,11 +1232,6 @@
  */
 void Canvas::drawControlsFreehandLine(QPainter* pp)
 {
-//	pp->resetMatrix();
-//	QPoint out = contentsToViewport(QPoint(0, 0));
-//	pp->translate(out.x(), out.y());
-//	pp->translate(-qRound(m_doc->minCanvasCoordinate.x()*m_viewMode.scale), -qRound(m_doc->minCanvasCoordinate.y()*m_viewMode.scale));
-//	pp->scale(m_viewMode.scale, m_viewMode.scale);
 	pp->setBrush(Qt::NoBrush);
 	pp->setPen(QPen(Qt::black, 1.0 / m_viewMode.scale, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin));
 	pp->drawPolyline(m_viewMode.redrawPolygon);

Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15839&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Thu Nov 11 22:47:45 2010
@@ -88,7 +88,6 @@
 	
 	friend class ScribusView; // for now...
 	friend class CanvasMode;
-	friend class LegacyMode;
 	friend class CanvasMode_CopyProperties;
 	friend class CanvasMode_Edit;
 	friend class CanvasMode_EditGradient;
@@ -222,8 +221,6 @@
 	void drawFrameLinks(ScPainter* painter);
 	void drawControls(QPainter* p);
 	void drawControlsMovingItemsRect(QPainter* pp);
-//	void drawControlsHighlightRect(QPainter* pp);
-	void drawControlsGradientVectors(QPainter* psx, PageItem *currItem);
 	void drawControlsBezierCurve(QPainter* pp, PageItem* currItem);
 	void drawControlsMeasurementLine(QPainter* pp);
 	void drawControlsDrawLine(QPainter* pp);

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15839&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Thu Nov 11 22:47:45 2010
@@ -27,7 +27,6 @@
 #include "canvasmode_editmeshgradient.h"
 #include "canvasmode_eyedropper.h"
 #include "canvasmode_framelinks.h"
-#include "canvasmode_legacy.h"
 #include "canvasmode_magnifier.h"
 #include "canvasmode_measurements.h"
 #include "canvasmode_nodeedit.h"
@@ -166,7 +165,7 @@
 			// more modes as they are defined...
 			
 		default:
-			result = new LegacyMode(view);
+			result = new CanvasMode_Normal(view);
 			break;
 	}
 	return result;

Modified: trunk/Scribus/scribus/canvasmode_editgradient.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15839&path=/trunk/Scribus/scribus/canvasmode_editgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editgradient.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editgradient.cpp Thu Nov 11 22:47:45 2010
@@ -36,7 +36,6 @@
 #include "fpoint.h"
 #include "fpointarray.h"
 #include "hyphenator.h"
-//#include "insertTable.h"
 #include "pageitem_textframe.h"
 #include "ui/pageselector.h"
 #include "prefscontext.h"
@@ -76,6 +75,160 @@
 	{
 		drawSelection(p, false);
 	}
+	if (m_doc->appMode == modeEditGradientVectors)
+	{
+		drawControlsGradientVectors(p, m_doc->m_Selection->itemAt(0));
+	}
+}
+
+void CanvasMode_EditGradient::drawControlsGradientVectors(QPainter* psx, PageItem *currItem)
+{
+//	psx->resetMatrix();
+//	QPoint out = contentsToViewport(QPoint(0, 0));
+//	psx->translate(out.x(), out.y());
+//	psx->translate(-qRound(m_doc->minCanvasCoordinate.x()*m_viewMode.scale), -qRound(m_doc->minCanvasCoordinate.y()*m_viewMode.scale));
+	//Transform(currItem, psx);
+	psx->translate(static_cast<int>(currItem->xPos()), static_cast<int>(currItem->yPos()));
+	psx->rotate(currItem->rotation());
+	psx->setPen(QPen(Qt::blue, 1.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
+	psx->setBrush(Qt::NoBrush);
+	if (m_view->editStrokeGradient == 1)
+	{
+		psx->drawLine(QPointF(currItem->GrStrokeStartX, currItem->GrStrokeStartY), QPointF(currItem->GrStrokeEndX, currItem->GrStrokeEndY));
+		psx->setPen(QPen(Qt::magenta, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
+		psx->drawPoint(QPointF(currItem->GrStrokeStartX, currItem->GrStrokeStartY));
+		psx->drawPoint(QPointF(currItem->GrStrokeEndX, currItem->GrStrokeEndY));
+		double radEnd = distance(currItem->GrStrokeEndX - currItem->GrStrokeStartX, currItem->GrStrokeEndY - currItem->GrStrokeStartY);
+		double rotEnd = xy2Deg(currItem->GrStrokeEndX - currItem->GrStrokeStartX, currItem->GrStrokeEndY - currItem->GrStrokeStartY);
+		QTransform qmatrix;
+		qmatrix.translate(currItem->GrStrokeStartX, currItem->GrStrokeStartY);
+		qmatrix.rotate(rotEnd);
+		double mask_gradientSkew = 0.0;
+		if (currItem->GrStrokeSkew == 90)
+			mask_gradientSkew = 1;
+		else if (currItem->GrStrokeSkew == 180)
+			mask_gradientSkew = 0;
+		else if (currItem->GrStrokeSkew == 270)
+			mask_gradientSkew = -1;
+		else if (currItem->GrStrokeSkew == 390)
+			mask_gradientSkew = 0;
+		else
+			mask_gradientSkew = tan(M_PI / 180.0 * currItem->GrStrokeSkew);
+		qmatrix.shear(mask_gradientSkew, 0);
+		qmatrix.translate(0, currItem->GrStrokeStartY * (1.0 - currItem->GrStrokeScale));
+		qmatrix.translate(-currItem->GrStrokeStartX, -currItem->GrStrokeStartY);
+		qmatrix.scale(1, currItem->GrStrokeScale);
+		if (currItem->GrTypeStroke == 7)
+			psx->drawPoint(qmatrix.map(QPointF(currItem->GrStrokeFocalX, currItem->GrStrokeFocalY)));
+		QTransform m;
+		m.translate(currItem->GrStrokeStartX, currItem->GrStrokeStartY);
+		m.rotate(rotEnd);
+		m.rotate(-90);
+		m.rotate(currItem->GrStrokeSkew);
+		m.translate(radEnd * currItem->GrStrokeScale, 0);
+		QPointF shP = m.map(QPointF(0,0));
+		psx->setPen(QPen(Qt::blue, 1.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
+		psx->drawLine(QPointF(currItem->GrStrokeStartX, currItem->GrStrokeStartY), shP);
+		psx->setPen(QPen(Qt::magenta, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
+		psx->drawPoint(shP);
+	}
+	else if (m_view->editStrokeGradient == 2)
+	{
+		psx->drawLine(QPointF(currItem->GrMaskStartX, currItem->GrMaskStartY), QPointF(currItem->GrMaskEndX, currItem->GrMaskEndY));
+		psx->setPen(QPen(Qt::magenta, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
+		psx->drawPoint(QPointF(currItem->GrMaskStartX, currItem->GrMaskStartY));
+		psx->drawPoint(QPointF(currItem->GrMaskEndX, currItem->GrMaskEndY));
+		double radEnd = distance(currItem->GrMaskEndX - currItem->GrMaskStartX, currItem->GrMaskEndY - currItem->GrMaskStartY);
+		double rotEnd = xy2Deg(currItem->GrMaskEndX - currItem->GrMaskStartX, currItem->GrMaskEndY - currItem->GrMaskStartY);
+		QTransform qmatrix;
+		qmatrix.translate(currItem->GrMaskStartX, currItem->GrMaskStartY);
+		qmatrix.rotate(rotEnd);
+		double mask_gradientSkew = 0.0;
+		if (currItem->GrMaskSkew == 90)
+			mask_gradientSkew = 1;
+		else if (currItem->GrMaskSkew == 180)
+			mask_gradientSkew = 0;
+		else if (currItem->GrMaskSkew == 270)
+			mask_gradientSkew = -1;
+		else if (currItem->GrMaskSkew == 390)
+			mask_gradientSkew = 0;
+		else
+			mask_gradientSkew = tan(M_PI / 180.0 * currItem->GrMaskSkew);
+		qmatrix.shear(mask_gradientSkew, 0);
+		qmatrix.translate(0, currItem->GrMaskStartY * (1.0 - currItem->GrMaskScale));
+		qmatrix.translate(-currItem->GrMaskStartX, -currItem->GrMaskStartY);
+		qmatrix.scale(1, currItem->GrMaskScale);
+		if ((currItem->GrMask == 2) || (currItem->GrMask == 5))
+			psx->drawPoint(qmatrix.map(QPointF(currItem->GrMaskFocalX, currItem->GrMaskFocalY)));
+		QTransform m;
+		m.translate(currItem->GrMaskStartX, currItem->GrMaskStartY);
+		m.rotate(rotEnd);
+		m.rotate(-90);
+		m.rotate(currItem->GrMaskSkew);
+		m.translate(radEnd * currItem->GrMaskScale, 0);
+		QPointF shP = m.map(QPointF(0,0));
+		psx->setPen(QPen(Qt::blue, 1.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
+		psx->drawLine(QPointF(currItem->GrMaskStartX, currItem->GrMaskStartY), shP);
+		psx->setPen(QPen(Qt::magenta, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
+		psx->drawPoint(shP);
+	}
+	else if (m_view->editStrokeGradient == 0)
+	{
+		psx->drawLine(QPointF(currItem->GrStartX, currItem->GrStartY), QPointF(currItem->GrEndX, currItem->GrEndY));
+		psx->setPen(QPen(Qt::magenta, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
+		psx->drawPoint(QPointF(currItem->GrStartX, currItem->GrStartY));
+		psx->drawPoint(QPointF(currItem->GrEndX, currItem->GrEndY));
+		double radEnd = distance(currItem->GrEndX - currItem->GrStartX, currItem->GrEndY - currItem->GrStartY);
+		double rotEnd = xy2Deg(currItem->GrEndX - currItem->GrStartX, currItem->GrEndY - currItem->GrStartY);
+		QTransform qmatrix;
+		qmatrix.translate(currItem->GrStartX, currItem->GrStartY);
+		qmatrix.rotate(rotEnd);
+		double mask_gradientSkew = 0.0;
+		if (currItem->GrSkew == 90)
+			mask_gradientSkew = 1;
+		else if (currItem->GrSkew == 180)
+			mask_gradientSkew = 0;
+		else if (currItem->GrSkew == 270)
+			mask_gradientSkew = -1;
+		else if (currItem->GrSkew == 390)
+			mask_gradientSkew = 0;
+		else
+			mask_gradientSkew = tan(M_PI / 180.0 * currItem->GrSkew);
+		qmatrix.shear(mask_gradientSkew, 0);
+		qmatrix.translate(0, currItem->GrStartY * (1.0 - currItem->GrScale));
+		qmatrix.translate(-currItem->GrStartX, -currItem->GrStartY);
+		qmatrix.scale(1, currItem->GrScale);
+		if (currItem->GrType == 7)
+			psx->drawPoint(qmatrix.map(QPointF(currItem->GrFocalX, currItem->GrFocalY)));
+		QTransform m;
+		m.translate(currItem->GrStartX, currItem->GrStartY);
+		m.rotate(rotEnd);
+		m.rotate(-90);
+		m.rotate(currItem->GrSkew);
+		m.translate(radEnd * currItem->GrScale, 0);
+		QPointF shP = m.map(QPointF(0,0));
+		psx->setPen(QPen(Qt::blue, 1.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
+		psx->drawLine(QPointF(currItem->GrStartX, currItem->GrStartY), shP);
+		psx->setPen(QPen(Qt::magenta, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
+		psx->drawPoint(shP);
+	}
+	else if (m_view->editStrokeGradient == 3)
+	{
+		psx->setPen(QPen(Qt::magenta, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
+		psx->drawPoint(QPointF(currItem->GrControl1.x(), currItem->GrControl1.y()));
+		psx->drawPoint(QPointF(currItem->GrControl2.x(), currItem->GrControl2.y()));
+		psx->drawPoint(QPointF(currItem->GrControl3.x(), currItem->GrControl3.y()));
+		psx->drawPoint(QPointF(currItem->GrControl4.x(), currItem->GrControl4.y()));
+	}
+	else if (m_view->editStrokeGradient == 4)
+	{
+		psx->setPen(QPen(Qt::magenta, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
+		psx->drawPoint(QPointF(currItem->GrControl1.x(), currItem->GrControl1.y()));
+		psx->drawPoint(QPointF(currItem->GrControl2.x(), currItem->GrControl2.y()));
+		psx->drawPoint(QPointF(currItem->GrControl3.x(), currItem->GrControl3.y()));
+		psx->drawPoint(QPointF(currItem->GrControl4.x(), currItem->GrControl4.y()));
+		psx->drawPoint(QPointF(currItem->GrControl5.x(), currItem->GrControl5.y()));
+	}
 }
 
 void CanvasMode_EditGradient::enterEvent(QEvent *)
@@ -159,14 +312,8 @@
 
 void CanvasMode_EditGradient::mouseMoveEvent(QMouseEvent *m)
 {
-// 	const double mouseX = m->globalX();
-// 	const double mouseY = m->globalY();
 	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
 	m->accept();
-//	qDebug() << "legacy mode move:" << m->x() << m->y() << m_canvas->globalToCanvas(m->globalPos()).x() << m_canvas->globalToCanvas(m->globalPos()).y();
-//	emit MousePos(m->x()/m_canvas->scale(),// + m_doc->minCanvasCoordinate.x(), 
-//				  m->y()/m_canvas->scale()); // + m_doc->minCanvasCoordinate.y());
-
 	if (m_gradientPoint == noPointDefined)
 		return;
 
@@ -175,8 +322,6 @@
 		PageItem *currItem = m_doc->m_Selection->itemAt(0);
 		double newX = mousePointDoc.x(); //m->x();
 		double newY = mousePointDoc.y(); //m->y();
-//		double dx = fabs(Mxp - newX) + 5.0 / m_canvas->scale();
-//		double dy = fabs(Myp - newY) + 5.0 / m_canvas->scale();
 		FPoint npx(Mxp - newX, Myp - newY, 0, 0, currItem->rotation(), 1, 1, true);
 		QPointF np = QPointF(npx.x(), npx.y());
 		if (m_view->editStrokeGradient == 1)

Modified: trunk/Scribus/scribus/canvasmode_editgradient.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15839&path=/trunk/Scribus/scribus/canvasmode_editgradient.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editgradient.h (original)
+++ trunk/Scribus/scribus/canvasmode_editgradient.h Thu Nov 11 22:47:45 2010
@@ -47,6 +47,7 @@
 	virtual void mouseMoveEvent(QMouseEvent *m);
 	virtual void mousePressEvent(QMouseEvent *m);
 	virtual void drawControls(QPainter* p);
+	void drawControlsGradientVectors(QPainter* psx, PageItem *currItem);
 
 private:
 

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15839&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Thu Nov 11 22:47:45 2010
@@ -211,6 +211,8 @@
 	zoomDefaultToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
 	zoomOutToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
 	zoomInToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
+	zoomInToolbarButton->setDefaultAction(m_ScMW->scrActions["toolsZoomIn"]);
+	zoomOutToolbarButton->setDefaultAction(m_ScMW->scrActions["toolsZoomOut"]);
 	cmsToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
 	cmsToolbarButton->setCheckable(true);
 	QIcon ic2;
@@ -239,6 +241,8 @@
 	zoomInToolbarButton->setDefault( false );
 	zoomInToolbarButton->setAutoDefault( false );
 	zoomInToolbarButton->setFlat(OPTION_FLAT_BUTTON);
+	zoomInToolbarButton->addAction(m_ScMW->scrActions["toolsZoomIn"]);
+	zoomOutToolbarButton->addAction(m_ScMW->scrActions["toolsZoomOut"]);
 	cmsToolbarButton = new QPushButton(this);
 	cmsToolbarButton->setFocusPolicy(Qt::NoFocus);
 	cmsToolbarButton->setDefault( false );
@@ -261,9 +265,7 @@
 	//zoomDefaultToolbarButton->setText("1:1");
 	zoomDefaultToolbarButton->setIcon(QIcon(loadIcon("16/zoom-original.png")));
 	zoomOutToolbarButton->setIcon(QIcon(loadIcon("16/zoom-out.png")));
-	zoomOutToolbarButton->addAction(m_ScMW->scrActions["toolsZoomOut"]);
 	zoomInToolbarButton->setIcon(QIcon(loadIcon("16/zoom-in.png")));
-	zoomInToolbarButton->addAction(m_ScMW->scrActions["toolsZoomIn"]);
 	pageSelector = new PageSelector(this, Doc->Pages->count());
 	pageSelector->setFont(fo);
 	pageSelector->setFocusPolicy(Qt::ClickFocus);

Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15839&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Thu Nov 11 22:47:45 2010
@@ -97,7 +97,6 @@
     ScribusView(QWidget* win=0, ScribusMainWindow* mw=0, ScribusDoc* doc=0);
     ~ScribusView();
 	
-	friend class LegacyMode;
 	friend class CanvasMode_CopyProperties;
 	friend class CanvasMode_Edit;
 	friend class CanvasMode_EditGradient;




More information about the scribus-commit mailing list