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:
@@ -51,7 +51,7 @@ void Camera::wheelEvent(QWheelEvent* event, const QVector3D& worldPos)
|
||||
QMatrix4x4 rotation;
|
||||
rotation.rotate(m_xRot / 16.0f, 1, 0, 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) {
|
||||
setZoom(newZoom);
|
||||
|
||||
@@ -239,7 +239,7 @@ void ViewportWidget::mouseMoveEvent(QMouseEvent *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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user