mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
folio: Fix delegate drop placement not accounting for view padding
This is exacerbated now that we have device-specific view margins (to deal with notches and the like), which caused the drag and drop positions to be wildly inaccurate.
This commit is contained in:
parent
f8fc2afa10
commit
81232b3ed7
1 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue