diff --git a/scribus/canvasgesture_rulermove.cpp b/scribus/canvasgesture_rulermove.cpp
index fdcf13da8..1badc9b79 100644
--- a/scribus/canvasgesture_rulermove.cpp
+++ b/scribus/canvasgesture_rulermove.cpp
@@ -187,11 +187,13 @@ void RulerGesture::movePoint(QMouseEvent* m, bool mouseRelease)
 	const int page = m_doc->OnPage(mousePointDoc.x(), mousePointDoc.y());
 	QRect viewport(m_view->viewport()->mapToGlobal(QPoint(0,0)), QSize(m_view->visibleWidth(), m_view->visibleHeight()));
 	QPoint newMousePoint = m->globalPos() - (m_canvas->mapToParent(QPoint(0, 0)) + m_canvas->parentWidget()->mapToGlobal(QPoint(0, 0)));
+	double x = mousePointDoc.x();
+	double y = mousePointDoc.y();
 	switch (m_mode)
 	{
 		case ORIGIN:
 			m_canvas->repaint();
-			m_canvas->displayCorrectedXYHUD(m->globalPos(), mousePointDoc.x(), mousePointDoc.y());
+			m_canvas->displayCorrectedXYHUD(m->globalPos(), x, y);
 			break;
 		case HORIZONTAL:
 			if (!m_ScMW->doc->guidesPrefs().guidesShown)
@@ -200,13 +202,21 @@ void RulerGesture::movePoint(QMouseEvent* m, bool mouseRelease)
 			m_canvas->update(0, newMousePoint.y()-2, m_canvas->width(), 4);
 			if ((page >= 0) && (viewport.contains(m->globalPos())))
 			{
+				if (m_doc->SnapElement) {
+					double xout = 0;
+					double yout = 0;
+					int GxM = -1, GyM = -1;
+					m_doc->getClosestElementBorder(x, y, &xout, &yout, &GxM, &GyM, m_doc->Pages->at(page));
+					if (GyM != -1)
+						y = yout+ m_doc->Pages->at(page)->yOffset();
+				}
 				if (!m_haveGuide)
 				{
 					qApp->changeOverrideCursor(QCursor(Qt::SplitVCursor));
 					if (mouseRelease)
 					{
-						m_doc->Pages->at(page)->guides.addHorizontal(mousePointDoc.y() - m_doc->Pages->at(page)->yOffset(), GuideManagerCore::Standard);
-						m_guide = mousePointDoc.y() - m_doc->Pages->at(page)->yOffset();
+						m_doc->Pages->at(page)->guides.addHorizontal(y - m_doc->Pages->at(page)->yOffset(), GuideManagerCore::Standard);
+						m_guide = y - m_doc->Pages->at(page)->yOffset();
 						m_page  = page;
 						m_haveGuide = true;
 						m_doc->changed();
@@ -215,11 +225,11 @@ void RulerGesture::movePoint(QMouseEvent* m, bool mouseRelease)
 				else if (mouseRelease)
 				{
 					if (page == m_page)
-						m_doc->Pages->at(page)->guides.moveHorizontal( m_guide, mousePointDoc.y() - m_doc->Pages->at(page)->yOffset(), GuideManagerCore::Standard);
+						m_doc->Pages->at(page)->guides.moveHorizontal( m_guide, y - m_doc->Pages->at(page)->yOffset(), GuideManagerCore::Standard);
 					else
 					{
 						m_doc->Pages->at(m_page)->guides.deleteHorizontal( m_guide, GuideManagerCore::Standard);
-						m_doc->Pages->at(page)->guides.addHorizontal(mousePointDoc.y() - m_doc->Pages->at(page)->yOffset(), GuideManagerCore::Standard);
+						m_doc->Pages->at(page)->guides.addHorizontal(y - m_doc->Pages->at(page)->yOffset(), GuideManagerCore::Standard);
 						m_page = page;
 					}
 					if (m_doc->currentPage() != m_doc->Pages->at(m_page))
@@ -232,7 +242,7 @@ void RulerGesture::movePoint(QMouseEvent* m, bool mouseRelease)
 					if (cursor && (cursor->shape() != Qt::SplitVCursor))
 						qApp->changeOverrideCursor(QCursor(Qt::SplitVCursor));
 				}
-				m_currentGuide = mousePointDoc.y() - m_doc->Pages->at(page)->yOffset();
+				m_currentGuide = y - m_doc->Pages->at(page)->yOffset();
 			}
 			else
 			{ 
@@ -247,7 +257,7 @@ void RulerGesture::movePoint(QMouseEvent* m, bool mouseRelease)
 					}
 				}
 			}
-			m_canvas->displayCorrectedSingleHUD(m->globalPos(), mousePointDoc.y(), false);
+			m_canvas->displayCorrectedSingleHUD(m->globalPos(), y, false);
 			break;
 		case VERTICAL:
 			if (!m_ScMW->doc->guidesPrefs().guidesShown)
@@ -256,13 +266,21 @@ void RulerGesture::movePoint(QMouseEvent* m, bool mouseRelease)
 			m_canvas->update(newMousePoint.x()-2, 0, 4, m_canvas->height());
 			if ((page >= 0) && viewport.contains(m->globalPos()))
 			{
+				if (m_doc->SnapElement) {
+					double xout = 0;
+					double yout = 0;
+					int GxM = -1, GyM = -1;
+					m_doc->getClosestElementBorder(x, y, &xout, &yout, &GxM, &GyM, m_doc->Pages->at(page));
+					if (GxM != -1)
+						x = xout+ m_doc->Pages->at(page)->xOffset();
+				}
 				if (!m_haveGuide)
 				{
 					qApp->changeOverrideCursor(QCursor(Qt::SplitHCursor));
 					if (mouseRelease)
 					{
-						m_doc->Pages->at(page)->guides.addVertical(mousePointDoc.x() - m_doc->Pages->at(page)->xOffset(), GuideManagerCore::Standard);
-						m_guide = mousePointDoc.x() - m_doc->Pages->at(page)->xOffset();
+						m_doc->Pages->at(page)->guides.addVertical(x - m_doc->Pages->at(page)->xOffset(), GuideManagerCore::Standard);
+						m_guide = x - m_doc->Pages->at(page)->xOffset();
 						m_page  = page;
 						m_haveGuide = true;
 						m_doc->changed();
@@ -271,11 +289,11 @@ void RulerGesture::movePoint(QMouseEvent* m, bool mouseRelease)
 				else if (mouseRelease)
 				{
 					if (page == m_page)
-						m_doc->Pages->at(page)->guides.moveVertical( m_guide, mousePointDoc.x() - m_doc->Pages->at(page)->xOffset(), GuideManagerCore::Standard);
+						m_doc->Pages->at(page)->guides.moveVertical( m_guide, x - m_doc->Pages->at(page)->xOffset(), GuideManagerCore::Standard);
 					else
 					{
 						m_doc->Pages->at(m_page)->guides.deleteVertical( m_guide, GuideManagerCore::Standard);
-						m_doc->Pages->at(page)->guides.addVertical(mousePointDoc.x() - m_doc->Pages->at(page)->xOffset(), GuideManagerCore::Standard);
+						m_doc->Pages->at(page)->guides.addVertical(x - m_doc->Pages->at(page)->xOffset(), GuideManagerCore::Standard);
 						m_page = page;
 					}
 					if (m_doc->currentPage() != m_doc->Pages->at(m_page))
@@ -288,7 +306,7 @@ void RulerGesture::movePoint(QMouseEvent* m, bool mouseRelease)
 					if (cursor && (cursor->shape() != Qt::SplitHCursor))
 						qApp->changeOverrideCursor(QCursor(Qt::SplitHCursor));
 				}
-				m_currentGuide = mousePointDoc.x() - m_doc->Pages->at(page)->xOffset();
+				m_currentGuide = x - m_doc->Pages->at(page)->xOffset();
 			}
 			else
 			{ 
@@ -303,7 +321,7 @@ void RulerGesture::movePoint(QMouseEvent* m, bool mouseRelease)
 					}
 				}
 			}
-			m_canvas->displayCorrectedSingleHUD(m->globalPos(), mousePointDoc.x(), true);
+			m_canvas->displayCorrectedSingleHUD(m->globalPos(), x, true);
 			break;
 	}
 	m_xy = newMousePoint;
