Skip to content
Permalink
Browse files

Qt/TAS: Fix issue #11620

  • Loading branch information...
spycrab committed Mar 25, 2019
1 parent 8bad3f9 commit 04583b17da28312166c92a686d2fdf6a95492976
@@ -61,11 +61,13 @@ void IRWidget::paintEvent(QPaintEvent* event)
void IRWidget::mousePressEvent(QMouseEvent* event)
{
handleMouseEvent(event);
m_ignore_movement = event->button() == Qt::RightButton;
}

void IRWidget::mouseMoveEvent(QMouseEvent* event)
{
handleMouseEvent(event);
if (!m_ignore_movement)
handleMouseEvent(event);
}

void IRWidget::handleMouseEvent(QMouseEvent* event)
@@ -31,6 +31,7 @@ public slots:
private:
u16 m_x = 0;
u16 m_y = 0;
bool m_ignore_movement = false;
};

// Should be part of class but fails to compile on mac os
@@ -62,11 +62,13 @@ void StickWidget::paintEvent(QPaintEvent* event)
void StickWidget::mousePressEvent(QMouseEvent* event)
{
handleMouseEvent(event);
m_ignore_movement = event->button() == Qt::RightButton;
}

void StickWidget::mouseMoveEvent(QMouseEvent* event)
{
handleMouseEvent(event);
if (!m_ignore_movement)
handleMouseEvent(event);
}

void StickWidget::handleMouseEvent(QMouseEvent* event)
@@ -33,4 +33,5 @@ public slots:
u16 m_max_y;
u16 m_x = 0;
u16 m_y = 0;
bool m_ignore_movement = false;
};

0 comments on commit 04583b1

Please sign in to comment.
You can’t perform that action at this time.