Skip to content
Snippets Groups Projects
Commit 02fcb4a0 authored by Romain Vimont's avatar Romain Vimont Committed by Jean-Baptiste Kempf
Browse files

qt: remove incorrect mouse event scaling

Since commit 66e86e15, m_sourceSize is
never written, and no scaling must be applied.

This makes hoverMoveEvent() consistent with mouseMoveEvent(), which did
not apply any scaling.

Fixes #25385
Fixes #26799
parent c6d72dff
No related branches found
No related tags found
1 merge request!1733qt: remove incorrect mouse event scaling
Pipeline #208912 passed with stage
in 1 hour, 15 minutes, and 24 seconds
......@@ -150,11 +150,6 @@ void VideoSurface::setCtx(MainCtx* ctx)
emit ctxChanged(ctx);
}
QSize VideoSurface::getSourceSize() const
{
return m_sourceSize;
}
int VideoSurface::qtMouseButton2VLC( Qt::MouseButton qtButton )
{
switch( qtButton )
......@@ -206,9 +201,7 @@ void VideoSurface::hoverMoveEvent(QHoverEvent* event)
QPointF current_pos = event->posF();
if (current_pos != m_oldHoverPos)
{
float scaleW = m_sourceSize.width() / width();
float scaleH = m_sourceSize.height() / height();
emit mouseMoved(current_pos.x() * scaleW, current_pos.y() * scaleH);
emit mouseMoved(current_pos.x(), current_pos.y());
m_oldHoverPos = current_pos;
}
event->accept();
......
......@@ -66,7 +66,6 @@ class VideoSurface : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(MainCtx* ctx READ getCtx WRITE setCtx NOTIFY ctxChanged FINAL)
Q_PROPERTY(QSize sourceSize READ getSourceSize NOTIFY sourceSizeChanged FINAL)
Q_PROPERTY(Qt::CursorShape cursorShape READ getCursorShape WRITE setCursorShape RESET unsetCursor FINAL)
public:
......@@ -75,8 +74,6 @@ public:
MainCtx* getCtx();
void setCtx(MainCtx* ctx);
QSize getSourceSize() const;
protected:
int qtMouseButton2VLC( Qt::MouseButton qtButton );
......@@ -100,7 +97,6 @@ protected:
signals:
void ctxChanged(MainCtx*);
void sourceSizeChanged(QSize);
void surfaceSizeChanged(QSizeF);
void surfacePositionChanged(QPointF);
......@@ -120,8 +116,6 @@ protected slots:
private:
MainCtx* m_ctx = nullptr;
bool m_sourceSizeChanged = false;
QSize m_sourceSize;
QPointF m_oldHoverPos;
VideoSurfaceProvider* m_provider = nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment