Use mouse ( i.e. hand grab ) location to determine which page to move object to when moving around.

presentation
JJones780 7 years ago
parent a17a3f2c80
commit b3077a85df
  1. 13
      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;
}

Loading…
Cancel
Save