View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0015555 | Scribus | Usability | public | 2019-01-25 08:38 | 2019-07-08 07:32 |
Reporter | ale | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | new | Resolution | open | ||
Summary | 0015555: Snap to items should only snap to visible items | ||||
Description | While it might sometimes be useful, snapping to items that are not visible is most of the time an obstacle, not a help. | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
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? |
|
i think that the original request was about the item in the viewbox... and not about an item being hidden behind other items... |
|
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); |