MCPcopy Create free account
hub / github.com/davy7125/polyphone / zoom

Method zoom

sources/editor/graphics/graphicsviewrange.cpp:882–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

880}
881
882void GraphicsViewRange::zoom(QPoint point)
883{
884 // Décalage
885 double decX = normalizeX(point.x()) - _xInit;
886 double decY = _yInit - normalizeY(point.y());
887
888 // Modification zoom & drag
889 _zoomX = _zoomXinit * pow(2, 10.0 * decX);
890 _zoomY = _zoomYinit * pow(2, 10.0 * decY);
891
892 // Ajustement posX et posY
893 if (_zoomX > 1)
894 _posX = (_zoomX * _posXinit * (_zoomXinit - 1) +
895 _xInit * (_zoomX - _zoomXinit)) / (_zoomXinit * (_zoomX - 1));
896 if (_zoomY > 1)
897 _posY = (_zoomY * _posYinit * (_zoomYinit - 1) +
898 _yInit * (_zoomY - _zoomYinit)) / (_zoomYinit * (_zoomY - 1));
899
900 // Mise à jour
901 this->zoomDrag();
902}
903
904void GraphicsViewRange::zoomDrag()
905{

Callers 1

mouseMoveEventMethod · 0.95

Calls 1

zoomDragMethod · 0.95

Tested by

no test coverage detected