From b3077a85df4834bcb6c8ce73fdbf0bf7303d6a5e Mon Sep 17 00:00:00 2001 From: JJones780 Date: Tue, 5 Mar 2019 01:11:37 -0700 Subject: [PATCH] Use mouse ( i.e. hand grab ) location to determine which page to move object to when moving around. --- src/control/tools/EditSelection.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/control/tools/EditSelection.cpp b/src/control/tools/EditSelection.cpp index 5b39480c..ce92f32f 100644 --- a/src/control/tools/EditSelection.cpp +++ b/src/control/tools/EditSelection.cpp @@ -562,9 +562,16 @@ XojPageView* EditSelection::getBestMatchingPageView() XOJ_CHECK_TYPE(EditSelection); PagePositionHandler* pp = this->view->getXournal()->getPagePositionHandler(); - int rx = this->getXOnViewAbsolute(); - int ry = this->getYOnViewAbsolute(); - XojPageView* v = pp->getBestMatchingView(rx, ry, this->getViewWidth(), this->getViewHeight()); + + double zoom = view->getXournal()->getZoom(); + + + //get grabbing hand position + double hx = this->view->getX() + (this->x + this->relMousePosX)*zoom; + double hy = this->view->getY() + (this->y + this->relMousePosY)*zoom; + + XojPageView* v = pp->getViewAt(hx,hy); + return v; }