/trunk/Scribus/scribus/canvasgesture_rulermove.cpp |
---|
207,7 → 207,7 |
{ |
double xout = 0; |
double yout = 0; |
m_doc->getClosestElementBorder(x, y, &xout, &yout, currentPage, ScribusDoc::IncludeSelection); |
m_doc->getClosestElementBorder(x, y, &xout, &yout, ScribusDoc::IncludeSelection); |
if (yout != y) |
{ |
y = yout; |
275,7 → 275,7 |
{ |
double xout = 0; |
double yout = 0; |
m_doc->getClosestElementBorder(x, y, &xout, &yout, currentPage, ScribusDoc::IncludeSelection); |
m_doc->getClosestElementBorder(x, y, &xout, &yout, ScribusDoc::IncludeSelection); |
if (xout != x) |
{ |
x = xout; |
/trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp |
---|
99,7 → 99,6 |
{ |
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos()); |
double newX, newY; |
PageItem *currItem; |
FPoint npf, npf2; |
// QRect tx; |
139,9 → 138,6 |
if (GetItem(&currItem)) |
{ |
newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x()); |
newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y()); |
if (m_doc->DragP) |
return; |
165,8 → 161,6 |
{ |
if ((m_mouseButtonPressed) && (m->buttons() & Qt::LeftButton)) |
{ |
newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x()); |
newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y()); |
QPoint startP = m_canvas->canvasToGlobal(QPointF(m_xp, m_yp)); |
m_view->redrawMarker->setGeometry(QRect(m_view->mapFromGlobal(startP), m_view->mapFromGlobal(m->globalPos())).normalized()); |
m_view->setRedrawMarkerShown(true); |
182,7 → 176,6 |
double Rxp = 0; |
double Ryp = 0; |
FPoint npf, npf2; |
// QRect tx; |
QTransform pm; |
m_mouseButtonPressed = true; |
/trunk/Scribus/scribus/canvasmode_drawfreehand.cpp |
---|
94,7 → 94,6 |
void FreehandMode::mouseMoveEvent(QMouseEvent *m) |
{ |
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos()); |
double newX, newY; |
PageItem *currItem; |
FPoint npf, npf2; |
// QRect tx; |
125,9 → 124,6 |
} |
if (GetItem(&currItem)) |
{ |
newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x()); |
newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y()); |
if (m_doc->DragP) |
return; |
151,8 → 147,6 |
{ |
if ((m_mouseButtonPressed) && (m->buttons() & Qt::LeftButton)) |
{ |
newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x()); |
newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y()); |
QPoint startP = m_canvas->canvasToGlobal(QPointF(m_xp, m_yp)); |
m_view->redrawMarker->setGeometry(QRect(m_view->mapFromGlobal(startP), m_view->mapFromGlobal(m->globalPos())).normalized()); |
m_view->setRedrawMarkerShown(true); |
/trunk/Scribus/scribus/scribusdoc.cpp |
---|
13944,11 → 13944,10 |
} |
} |
void ScribusDoc::getClosestElementBorder(double xin, double yin, double *xout, double *yout, ScPage* refPage, SelectionSkipBehavior behavior) |
void ScribusDoc::getClosestElementBorder(double xin, double yin, double *xout, double *yout, SelectionSkipBehavior behavior) |
{ |
int gxM = -1; |
int gyM = -1; |
ScPage* page = (refPage == nullptr) ? currentPage() : refPage; |
QMap<double, uint> tmpGuidesSel; |
double viewScale = m_View->scale(); |
const double snappingDistance = prefsData().guidesPrefs.guideRad / viewScale; |
14075,11 → 14074,11 |
void ScribusDoc::SnapToGuides(PageItem *currItem) |
{ |
int pg = OnPage(currItem); |
double xout, yout; |
if (pg == -1) |
return; |
ScPage* page = Pages->at(pg); |
double xout, yout; |
getClosestGuides(0, currItem->yPos(), &xout, &yout); |
if (currItem->yPos() != yout) |
currItem->setYPos(yout); |
14136,7 → 14135,7 |
if (!elementSnap) |
getClosestGuides(*x, *y, &xout, &yout, page); |
else |
getClosestElementBorder(*x, *y, &xout, &yout, page, ExcludeSelection); |
getClosestElementBorder(*x, *y, &xout, &yout, ExcludeSelection); |
if ((*x != xout) || (*y != yout)) |
ret = true; |
/trunk/Scribus/scribus/scribusdoc.h |
---|
1187,7 → 1187,7 |
//! \brief Get the closest guide to the given point |
void getClosestGuides(double xin, double yin, double *xout, double *yout, ScPage* refPage = nullptr); |
//! \brief Get the closest border of another element to the given point |
void getClosestElementBorder(double xin, double yin, double *xout, double *yout, ScPage* refPage = nullptr, SelectionSkipBehavior behavior = IncludeSelection); |
void getClosestElementBorder(double xin, double yin, double *xout, double *yout, SelectionSkipBehavior behavior = IncludeSelection); |
//! \brief Get the closest page margin or bleed |
void getClosestPageBoundaries(const double xin, const double yin, double &xout, double &yout, ScPage* refPage); |
//! \brief Snap an item to the guides |