#12434 add GUI debug messages for pinch-to-zoom gesture

This commit is contained in:
Stephan Witt 2022-01-09 12:29:02 +01:00
parent 7134ebd793
commit 22045e455a

View File

@ -1632,11 +1632,15 @@ bool GuiView::event(QEvent * e)
if (gp) {
QPinchGesture *pinch = static_cast<QPinchGesture *>(gp);
QPinchGesture::ChangeFlags changeFlags = pinch->changeFlags();
qreal totalScaleFactor = pinch->totalScaleFactor();
LYXERR(Debug::GUI, "totalScaleFactor: " << totalScaleFactor);
if (pinch->state() == Qt::GestureStarted) {
initialZoom_ = lyxrc.currentZoom;
LYXERR(Debug::GUI, "initialZoom_: " << initialZoom_);
}
if (changeFlags & QPinchGesture::ScaleFactorChanged) {
qreal factor = initialZoom_ * pinch->totalScaleFactor();
qreal factor = initialZoom_ * totalScaleFactor;
LYXERR(Debug::GUI, "scaleFactor: " << factor);
zoomValueChanged(factor);
}
}