r16886 by craig - Get rid of some more rubbish.. for work on #9892
scribus-commit
scribus-commit at lists.scribus.net
Wed Oct 5 21:47:38 UTC 2011
Author: craig
Date: Wed Oct 5 21:47:37 2011
New Revision: 16886
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16886
Log:
Get rid of some more rubbish.. for work on #9892
Modified:
branches/Version135/Scribus/scribus/canvasmode_edit.cpp
branches/Version135/Scribus/scribus/canvasmode_editgradient.cpp
branches/Version135/Scribus/scribus/canvasmode_framelinks.cpp
branches/Version135/Scribus/scribus/canvasmode_magnifier.cpp
branches/Version135/Scribus/scribus/canvasmode_nodeedit.cpp
branches/Version135/Scribus/scribus/canvasmode_normal.cpp
branches/Version135/Scribus/scribus/canvasmode_rotate.cpp
Modified: branches/Version135/Scribus/scribus/canvasmode_edit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16886&path=/branches/Version135/Scribus/scribus/canvasmode_edit.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_edit.cpp (original)
+++ branches/Version135/Scribus/scribus/canvasmode_edit.cpp Wed Oct 5 21:47:37 2011
@@ -591,16 +591,11 @@
void CanvasMode_Edit::mousePressEvent(QMouseEvent *m)
{
-// const double mouseX = m->globalX();
-// const double mouseY = m->globalY();
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
bool inText;
double Rxp = 0;
double Ryp = 0;
-// Not used said gcc
-// double Rxpd = 0;
-// double Rypd = 0;
PageItem *currItem;
m_canvas->PaintSizeRect(QRect());
FPoint npf, npf2;
@@ -610,13 +605,10 @@
m_view->HaveSelRect = false;
m_doc->DragP = false;
m_doc->leaveDrag = false;
-// oldClip = 0;
m->accept();
m_view->registerMousePress(m->globalPos());
- Mxp = mousePointDoc.x(); //qRound(m->x()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.x());
- Myp = mousePointDoc.y(); //qRound(m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
-// QRect mpo(m->x()-m_doc->guidesSettings.grabRad, m->y()-m_doc->guidesSettings.grabRad, m_doc->guidesSettings.grabRad*2, m_doc->guidesSettings.grabRad*2);
-// mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(m_doc->minCanvasCoordinate.y() * m_canvas->scale()));
+ Mxp = mousePointDoc.x();
+ Myp = mousePointDoc.y();
Ryp = Myp;
Rxp = Mxp;
SeRx = Mxp;
@@ -1022,15 +1014,13 @@
PageItem *currItem;
m_canvas->m_viewMode.m_MouseButtonPressed = true;
FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
- Mxp = mousePointDoc.x(); //m->x()/m_canvas->scale());
- Myp = mousePointDoc.y(); //m->y()/m_canvas->scale());
+ Mxp = mousePointDoc.x();
+ Myp = mousePointDoc.y();
double grabRadius = m_doc->guidesSettings.grabRad / m_canvas->scale();
- int MxpS = static_cast<int>(mousePointDoc.x()); //m->x()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.x());
- int MypS = static_cast<int>(mousePointDoc.y()); //m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
+ int MxpS = static_cast<int>(mousePointDoc.x());
+ int MypS = static_cast<int>(mousePointDoc.y());
mpo = QRectF(Mxp-grabRadius, Myp-grabRadius, grabRadius*2, grabRadius*2);
-// mpo.translate(m_doc->minCanvasCoordinate.x() * m_canvas->scale(), m_doc->minCanvasCoordinate.y() * m_canvas->scale());
m_doc->nodeEdit.deselect();
-// int a;
if (!m_doc->masterPageMode())
{
int pgNum = -1;
Modified: branches/Version135/Scribus/scribus/canvasmode_editgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16886&path=/branches/Version135/Scribus/scribus/canvasmode_editgradient.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_editgradient.cpp (original)
+++ branches/Version135/Scribus/scribus/canvasmode_editgradient.cpp Wed Oct 5 21:47:37 2011
@@ -163,13 +163,9 @@
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;
Modified: branches/Version135/Scribus/scribus/canvasmode_framelinks.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16886&path=/branches/Version135/Scribus/scribus/canvasmode_framelinks.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_framelinks.cpp (original)
+++ branches/Version135/Scribus/scribus/canvasmode_framelinks.cpp Wed Oct 5 21:47:37 2011
@@ -160,8 +160,8 @@
// oldClip = 0;
m->accept();
m_view->registerMousePress(m->globalPos());
- Mxp = mousePointDoc.x(); //qRound(m->x()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.x());
- Myp = mousePointDoc.y(); //qRound(m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
+ Mxp = mousePointDoc.x();
+ Myp = mousePointDoc.y();
Rxp = m_doc->ApplyGridF(FPoint(Mxp, Myp)).x();
Mxp = qRound(Rxp);
Ryp = m_doc->ApplyGridF(FPoint(Mxp, Myp)).y();
@@ -335,8 +335,8 @@
FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
Mxp = mousePointDoc.x(); //m->x()/m_canvas->scale());
Myp = mousePointDoc.y(); //m->y()/m_canvas->scale());
- int MxpS = static_cast<int>(mousePointDoc.x()); //m->x()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.x());
- int MypS = static_cast<int>(mousePointDoc.y()); //m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
+ int MxpS = static_cast<int>(mousePointDoc.x());
+ int MypS = static_cast<int>(mousePointDoc.y());
m_doc->nodeEdit.deselect();
if (!m_doc->masterPageMode())
{
Modified: branches/Version135/Scribus/scribus/canvasmode_magnifier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16886&path=/branches/Version135/Scribus/scribus/canvasmode_magnifier.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_magnifier.cpp (original)
+++ branches/Version135/Scribus/scribus/canvasmode_magnifier.cpp Wed Oct 5 21:47:37 2011
@@ -153,8 +153,8 @@
m_doc->leaveDrag = false;
m->accept();
m_view->registerMousePress(m->globalPos());
- Mxp = mousePointDoc.x(); //qRound(m->x()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.x());
- Myp = mousePointDoc.y(); //qRound(m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
+ Mxp = mousePointDoc.x();
+ Myp = mousePointDoc.y();
Rxp = m_doc->ApplyGridF(FPoint(Mxp, Myp)).x();
Mxp = qRound(Rxp);
Ryp = m_doc->ApplyGridF(FPoint(Mxp, Myp)).y();
Modified: branches/Version135/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16886&path=/branches/Version135/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_nodeedit.cpp (original)
+++ branches/Version135/Scribus/scribus/canvasmode_nodeedit.cpp Wed Oct 5 21:47:37 2011
@@ -1087,8 +1087,8 @@
*/
Mxp = m->x();
Myp = m->y();
- Dxp = qRound(m->x()/m_canvas->scale()); // + m_doc->minCanvasCoordinate.x());
- Dyp = qRound(m->y()/m_canvas->scale()); // + m_doc->minCanvasCoordinate.y());
+ Dxp = qRound(m->x()/m_canvas->scale());
+ Dyp = qRound(m->y()/m_canvas->scale());
if (!m_rectangleSelect)
m_rectangleSelect = new RectSelect(this);
m_rectangleSelect->prepare(m->globalPos());
Modified: branches/Version135/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16886&path=/branches/Version135/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_normal.cpp (original)
+++ branches/Version135/Scribus/scribus/canvasmode_normal.cpp Wed Oct 5 21:47:37 2011
@@ -235,8 +235,6 @@
void CanvasMode_Normal::mouseMoveEvent(QMouseEvent *m)
{
// qDebug()<<"CanvasMode_Normal::mouseMoveEvent";
-// const double mouseX = m->globalX();
-// const double mouseY = m->globalY();
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
m_lastPosWasOverGuide = false;
@@ -245,8 +243,6 @@
bool erf = false;
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 (commonMouseMove(m))
return;
@@ -524,12 +520,9 @@
{
if (m_doc->m_Selection->isMultipleSelection())
{
-// QRect mpo = QRect(qRound(m->x()/m_canvas->scale())-m_doc->guidesSettings.grabRad, qRound(m->y()/m_canvas->scale())-m_doc->guidesSettings.grabRad, m_doc->guidesSettings.grabRad*2, m_doc->guidesSettings.grabRad*2);
-// mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x()), qRound(m_doc->minCanvasCoordinate.y()));
double gx, gy, gh, gw;
m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
int how = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
-// if ((QRect(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh)).intersects(mpo))
if (how >= 0)
{
if (how > 0)
@@ -555,7 +548,7 @@
QMatrix p;
m_canvas->Transform(currItem, p);
QRect mpo = QRect(m->x()-m_doc->guidesSettings.grabRad, m->y()-m_doc->guidesSettings.grabRad, m_doc->guidesSettings.grabRad*2, m_doc->guidesSettings.grabRad*2);
-// mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(m_doc->minCanvasCoordinate.y() * m_canvas->scale()));
+
if ((QRegion(p.map(QPolygon(QRect(-3, -3, static_cast<int>(currItem->width()+6), static_cast<int>(currItem->height()+6))))).contains(mpo)))
{
QRect tx = p.mapRect(QRect(0, 0, static_cast<int>(currItem->width()), static_cast<int>(currItem->height())));
@@ -625,8 +618,6 @@
m->accept();
m_view->registerMousePress(m->globalPos());
QRect mpo(m->x()-m_doc->guidesSettings.grabRad, m->y()-m_doc->guidesSettings.grabRad, m_doc->guidesSettings.grabRad*2, m_doc->guidesSettings.grabRad*2);
-// mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(m_doc->minCanvasCoordinate.y() * m_canvas->scale()));
-
if (m->button() == Qt::MidButton)
{
m_view->MidButt = true;
@@ -1039,10 +1030,9 @@
FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
m_mouseCurrentPoint = mousePointDoc;
double grabRadius = m_doc->guidesSettings.grabRad / m_canvas->scale();
- int MxpS = static_cast<int>(mousePointDoc.x()); //m->x()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.x());
- int MypS = static_cast<int>(mousePointDoc.y()); //m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
+ int MxpS = static_cast<int>(mousePointDoc.x());
+ int MypS = static_cast<int>(mousePointDoc.y());
QRectF mpo(m_mouseCurrentPoint.x()-grabRadius, m_mouseCurrentPoint.y()-grabRadius, grabRadius*2, grabRadius*2);
-// mpo.translate(m_doc->minCanvasCoordinate.x() * m_canvas->scale(), m_doc->minCanvasCoordinate.y() * m_canvas->scale());
m_doc->nodeEdit.deselect();
if(!m_doc->guidesSettings.before) // guides are on foreground and want to be processed first
Modified: branches/Version135/Scribus/scribus/canvasmode_rotate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16886&path=/branches/Version135/Scribus/scribus/canvasmode_rotate.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_rotate.cpp (original)
+++ branches/Version135/Scribus/scribus/canvasmode_rotate.cpp Wed Oct 5 21:47:37 2011
@@ -65,8 +65,6 @@
double itemRotation;
p->save();
- /*p->scale(m_canvas->scale(), m_canvas->scale());
- p->translate(-m_doc->minCanvasCoordinate.x(), -m_doc->minCanvasCoordinate.y());*/
QColor drawColor = qApp->palette().color(QPalette::Active, QPalette::Highlight);
p->setRenderHint(QPainter::Antialiasing);
More information about the scribus-commit
mailing list