r21519 by craig - #14179: Rotate Item show wrong icon, frame middle point <FirasH>
scribus-commit
scribus-commit at lists.scribus.net
Fri Nov 18 23:00:33 UTC 2016
Author: craig
Date: Fri Nov 18 23:00:33 2016
New Revision: 21519
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21519
Log:
#14179: Rotate Item show wrong icon, frame middle point <FirasH>
Modified:
trunk/Scribus/scribus/canvasmode_normal.cpp
trunk/Scribus/scribus/canvasmode_rotate.cpp
trunk/Scribus/scribus/scribusview.cpp
Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21519&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Fri Nov 18 23:00:33 2016
@@ -774,10 +774,6 @@
m_view->HandleCurs(currItem, mpo);
}
}
- else
- {
-// setModeCursor();
- }
}
if (GetItem(&currItem) && (m_doc->appMode == modeNormal))
{
Modified: trunk/Scribus/scribus/canvasmode_rotate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21519&path=/trunk/Scribus/scribus/canvasmode_rotate.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_rotate.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_rotate.cpp Fri Nov 18 23:00:33 2016
@@ -387,7 +387,6 @@
m_angleConstrained = false;
PageItem *currItem;
- QRect tx;
m->accept();
if (GetItem(&currItem))
@@ -407,7 +406,7 @@
{
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));
+ int how = m_canvas->frameHitTest(QPointF(mousePointDoc.x(), mousePointDoc.y()), QRectF(gx, gy, gw, gh));
if (how >= 0)
{
if (how > 0)
@@ -429,20 +428,12 @@
break;
QTransform p;
m_canvas->Transform(currItem, p);
- QRect mpo = QRect(m->x()-m_doc->guidesPrefs().grabRadius, m->y()-m_doc->guidesPrefs().grabRadius, m_doc->guidesPrefs().grabRadius*2, m_doc->guidesPrefs().grabRadius*2);
- if ((QRegion(p.map(QPolygon(QRect(-3, -3, static_cast<int>(currItem->width()+6), static_cast<int>(currItem->height()+6))))).contains(mpo)))
+ QRect mpo = QRect(m->x() - m_doc->guidesPrefs().grabRadius, m->y() - m_doc->guidesPrefs().grabRadius, m_doc->guidesPrefs().grabRadius * 2, m_doc->guidesPrefs().grabRadius * 2);
+ if ((QRegion(p.map(QPolygon(QRect(-3, -3, static_cast<int>(currItem->width() + 6), static_cast<int>(currItem->height() + 6))))).contains(mpo)))
{
- tx = p.mapRect(QRect(0, 0, static_cast<int>(currItem->width()), static_cast<int>(currItem->height())));
+ QRect tx = p.mapRect(QRect(0, 0, static_cast<int>(currItem->width()), static_cast<int>(currItem->height())));
if ((tx.intersects(mpo)) && (!currItem->locked()))
- {
m_view->setCursor(IconManager::instance()->loadCursor("Rotieren2.png"));
- if (!currItem->sizeLocked())
- m_view->HandleCurs(currItem, mpo);
- }
- }
- else
- {
-// setModeCursor();
}
}
}
@@ -474,28 +465,3 @@
delete cmen;
}
-// void CanvasMode_Rotate::setResizeCursor(int how)
-// {
-// switch (how)
-// {
-// case 1:
-// case 2:
-// qApp->changeOverrideCursor(QCursor(Qt::SizeFDiagCursor));
-// break;
-// case 3:
-// case 4:
-// qApp->changeOverrideCursor(QCursor(Qt::SizeBDiagCursor));
-// break;
-// case 5:
-// case 8:
-// qApp->changeOverrideCursor(QCursor(Qt::SizeVerCursor));
-// break;
-// case 6:
-// case 7:
-// qApp->changeOverrideCursor(QCursor(Qt::SizeHorCursor));
-// break;
-// default:
-// qApp->changeOverrideCursor(QCursor(Qt::SizeAllCursor));
-// break;
-// }
-// }
Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21519&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Fri Nov 18 23:00:33 2016
@@ -1767,16 +1767,11 @@
tx2 = ma.map(QPoint(0, static_cast<int>(currItem->height())));
if (mpo.contains(tx) || mpo.contains(tx2))
{
- if (Doc->appMode == modeRotation)
- setCursor(IconManager::instance()->loadCursor("Rotieren2.png"));
- else
- {
- double rr = fabs(currItem->rotation());
- if (((rr >= 0.0) && (rr < 45.0)) || ((rr >= 135.0) && (rr < 225.0)) || ((rr >=315.0) && (rr <= 360.0)))
- setCursor(QCursor(Qt::SizeBDiagCursor));
- if (((rr >= 45.0) && (rr < 135.0)) || ((rr >= 225.0) && (rr < 315.0)))
- setCursor(QCursor(Qt::SizeFDiagCursor));
- }
+ double rr = fabs(currItem->rotation());
+ if (((rr >= 0.0) && (rr < 45.0)) || ((rr >= 135.0) && (rr < 225.0)) || ((rr >=315.0) && (rr <= 360.0)))
+ setCursor(QCursor(Qt::SizeBDiagCursor));
+ if (((rr >= 45.0) && (rr < 135.0)) || ((rr >= 225.0) && (rr < 315.0)))
+ setCursor(QCursor(Qt::SizeFDiagCursor));
}
tx = ma.map(QPoint(static_cast<int>(currItem->width()), static_cast<int>(currItem->height())/2));
tx2 = ma.map(QPoint(0, static_cast<int>(currItem->height())/2));
@@ -1802,9 +1797,7 @@
tx2 = ma.map(QPoint(0, 0));
if (mpo.contains(tx) || mpo.contains(tx2))
{
- if (Doc->appMode == modeRotation)
- setCursor(IconManager::instance()->loadCursor("Rotieren2.png"));
- else if (!currItem->sizeHLocked() && ! currItem->sizeVLocked())
+ if (!currItem->sizeHLocked() && ! currItem->sizeVLocked())
{
double rr = fabs(currItem->rotation());
if (((rr >= 0.0) && (rr < 45.0)) || ((rr >= 135.0) && (rr < 225.0)) ||
@@ -1814,8 +1807,6 @@
setCursor(QCursor(Qt::SizeBDiagCursor));
}
}
- if (Doc->appMode == modeEditClip)
- setCursor(QCursor(Qt::CrossCursor));
}
void ScribusView::SelectItemNr(uint nr, bool draw, bool single)
More information about the scribus-commit
mailing list