View Issue Details

IDProjectCategoryView StatusLast Update
0015555ScribusUsabilitypublic2019-07-08 07:32
Reporterale Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Summary0015555: Snap to items should only snap to visible items
DescriptionWhile it might sometimes be useful, snapping to items that are not visible is most of the time an obstacle, not a help.
TagsNo tags attached.
PatchNo

Activities

ale

2019-03-26 08:05

manager   ~0046042

jean, craig, do you know if scribus provides the information that an item is currently visible on screen?
or if it is easy to somehow get that information...
is there already code somewhere doing that?

ale

2019-03-26 08:14

manager   ~0046043

i think that the original request was about the item in the viewbox... and not about an item being hidden behind other items...

ale

2019-07-08 07:32

manager   ~0046370

note to self:

i did some tests, but failed to get the coordinates to match between the mouse position and the items' positions... or so...

if i try it again in the future, here is what i did try:

diff --git a/scribus/canvasmode.cpp b/scribus/canvasmode.cpp
index 63120725d..9f3cbe0e9 100644
--- a/scribus/canvasmode.cpp
+++ b/scribus/canvasmode.cpp
@@ -945,6 +945,15 @@ void CanvasMode::clearPixmapCache()

 void CanvasMode::drawSnapLine(QPainter* p)
 {
+ PageItem* ci;
+ if (m_doc->getItem(&ci)) {
+ // qDebug() << "i " << m_canvas->canvasToGlobal(QPointF(ci->xPos(), ci->yPos()));
+ // qDebug() << ". " << m_canvas->canvasToGlobal(QPointF(ci->xPos(), ci->yPos()));
+ // qDebug() << "c " << m_canvas->exposedRect();
+ // qDebug() << "v " << m_canvas->canvasToGlobal(QRect(m_view->contentsX(), m_view->contentsY(),
+ // m_view->contentsWidth(), m_view->contentsHeight()));
+ }
+
        if (!m_doc->SnapElement)
                return;
        if (xSnap == 0.0 && ySnap == 0.0)
@@ -960,6 +969,9 @@ void CanvasMode::drawSnapLine(QPainter* p)
        double xOffset = dragToPage->xOffset() - bleedValues.left();
        double yOffset = dragToPage->yOffset() - bleedValues.top();
        QPoint pageOrigin = m_canvas->canvasToLocal(QPointF(xOffset, yOffset));
+ // qDebug() << "g " << m_canvas->canvasToLocal(QPointF(xOffset, yOffset));
+ // qDebug() << "0 " << m_canvas->canvasToGlobal(QPointF(0, 0));
+ // qDebug() << "p " << QPointF(xOffset, yOffset);
        if (ySnap)
        {
                p->setPen(Qt::green);

Issue History

Date Modified Username Field Change
2019-01-25 08:38 ale New Issue
2019-03-26 08:05 ale Note Added: 0046042
2019-03-26 08:14 ale Note Added: 0046043
2019-07-08 07:32 ale Note Added: 0046370