Fix Color Wheel background
This commit is contained in:
parent
27fb7984f8
commit
11b3f55b94
2 changed files with 8 additions and 0 deletions
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue