Commit 1fc507cb authored by Julius Künzel's avatar Julius Künzel
Browse files

Fix color picker corruption

Fixes #800
parent 91912ff5
Pipeline #51784 canceled with stage
...@@ -143,6 +143,8 @@ void ColorPickerWidget::slotGetAverageColor() ...@@ -143,6 +143,8 @@ void ColorPickerWidget::slotGetAverageColor()
#ifdef Q_WS_X11 #ifdef Q_WS_X11
XDestroyImage(m_image); XDestroyImage(m_image);
m_image = nullptr; m_image = nullptr;
#else
m_image = QImage();
#endif #endif
emit colorPicked(QColor(sumR / numPixel, sumG / numPixel, sumB / numPixel)); emit colorPicked(QColor(sumR / numPixel, sumG / numPixel, sumB / numPixel));
...@@ -175,8 +177,7 @@ void ColorPickerWidget::mouseReleaseEvent(QMouseEvent *event) ...@@ -175,8 +177,7 @@ void ColorPickerWidget::mouseReleaseEvent(QMouseEvent *event)
m_grabRect = m_grabRect.normalized(); m_grabRect = m_grabRect.normalized();
if (m_grabRect.width() * m_grabRect.height() == 0) { if (m_grabRect.width() * m_grabRect.height() == 0) {
m_grabRectFrame->hide(); emit colorPicked(m_mouseColor);
emit colorPicked(grabColor(event->globalPos()));
emit disableCurrentFilter(false); emit disableCurrentFilter(false);
} else { } else {
// delay because m_grabRectFrame does not hide immediately // delay because m_grabRectFrame does not hide immediately
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment