Fix Color Wheel background

This commit is contained in:
silas
2021-02-27 10:26:45 -06:00
parent 27fb7984f8
commit 11b3f55b94
2 changed files with 8 additions and 0 deletions

View File

@@ -343,6 +343,8 @@ void ColorWheel::drawWheelImage(const QSize &newSize)
QRegion subRe( r/2, r/2, r-tmp, r-tmp, QRegion::Ellipse );
subRe.translate( x_offset - (r-tmp)/2, y_offset - (r-tmp)/2);
wheelRegion -= subRe;
CleanWheel = QPixmap().fromImage(wheelImage);
}
void ColorWheel::drawSquareImage(const int &hue)
@@ -399,6 +401,7 @@ void ColorWheel::drawSquareImage(const int &hue)
| Calculate square region |
\*-----------------------------------------------------*/
squareRegion = QRegion(x_offset + m, y_offset + m, SquareWidth, SquareWidth);
CleanSquare = squareImage;
}
void ColorWheel::drawIndicator(const int &hue)
@@ -461,6 +464,8 @@ void ColorWheel::drawPicker(const QColor &color)
void ColorWheel::composeWheel()
{
wheel = CleanWheel;
squareImage = CleanSquare;
QPainter composePainter(&wheel);
composePainter.drawImage(0, 0, wheelImage);
composePainter.drawImage(squareRegion.boundingRect().topLeft(), squareImage);

View File

@@ -42,6 +42,9 @@ private:
int x_offset;
int y_offset;
QPixmap CleanWheel;
QImage CleanSquare;
QColor posColor(const QPoint &point);
void drawWheelImage(const QSize &newSize);
void drawIndicator(const int &hue);