mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2025-12-23 23:37:48 -05:00
Fix Color Wheel background
This commit is contained in:
5
dependencies/ColorWheel/ColorWheel.cpp
vendored
5
dependencies/ColorWheel/ColorWheel.cpp
vendored
@@ -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);
|
||||
|
||||
3
dependencies/ColorWheel/ColorWheel.h
vendored
3
dependencies/ColorWheel/ColorWheel.h
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user