fix: Update Qt API usage for QWheelEvent and QMatrix4x4

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-17 11:37:42 -07:00
parent 38e931bc79
commit 6721caca9f
2 changed files with 2 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ void Camera::wheelEvent(QWheelEvent* event, const QVector3D& worldPos)
QMatrix4x4 rotation; QMatrix4x4 rotation;
rotation.rotate(m_xRot / 16.0f, 1, 0, 0); rotation.rotate(m_xRot / 16.0f, 1, 0, 0);
rotation.rotate(m_yRot / 16.0f, 0, 1, 0); rotation.rotate(m_yRot / 16.0f, 0, 1, 0);
QVector3D p_camera = rotation * worldPos; QVector3D p_camera = rotation.map(worldPos);
if (std::abs(p_camera.z() + oldZoom) < 1e-6) { if (std::abs(p_camera.z() + oldZoom) < 1e-6) {
setZoom(newZoom); setZoom(newZoom);

View File

@@ -239,7 +239,7 @@ void ViewportWidget::mouseMoveEvent(QMouseEvent *event)
void ViewportWidget::wheelEvent(QWheelEvent *event) void ViewportWidget::wheelEvent(QWheelEvent *event)
{ {
QVector3D worldPos = unproject(event->pos(), m_currentPlane); QVector3D worldPos = unproject(event->position().toPoint(), m_currentPlane);
m_camera->wheelEvent(event, worldPos); m_camera->wheelEvent(event, worldPos);
} }