diff --git a/containments/homescreens/folio/dragstate.cpp b/containments/homescreens/folio/dragstate.cpp index 972b2378..bc0d6771 100644 --- a/containments/homescreens/folio/dragstate.cpp +++ b/containments/homescreens/folio/dragstate.cpp @@ -407,12 +407,12 @@ void DragState::onDelegateDragPositionOverPageViewChanged() if (m_dropDelegate && m_dropDelegate->type() == FolioDelegate::Widget) { // for widgets, we use their top left position to determine where they are placed (since they are larger than one cell) - row = (delegateY - pageVerticalMargin) / m_state->pageCellHeight(); - column = (delegateX - pageHorizontalMargin) / m_state->pageCellWidth(); + row = (delegateY - pageVerticalMargin - m_state->viewTopPadding()) / m_state->pageCellHeight(); + column = (delegateX - pageHorizontalMargin - m_state->viewLeftPadding()) / m_state->pageCellWidth(); } else { // otherwise, we base it on the pointer position - row = (y - pageVerticalMargin) / m_state->pageCellHeight(); - column = (x - pageHorizontalMargin) / m_state->pageCellWidth(); + row = (y - pageVerticalMargin - m_state->viewTopPadding()) / m_state->pageCellHeight(); + column = (x - pageHorizontalMargin - m_state->viewLeftPadding()) / m_state->pageCellWidth(); } // ensure it's in bounds