colordialog: updated to show input/reference/display values

This commit is contained in:
itsmattkc
2020-04-15 18:11:46 +10:00
parent 9cc4349054
commit 32969d2403
11 changed files with 267 additions and 72 deletions
+4 -3
View File
@@ -55,8 +55,8 @@ void ColorWheelWidget::paintEvent(QPaintEvent *e)
int diameter = GetDiameter();
// Half diameter (add one to ensure the division rounds up)
int radius = (diameter + 1) / 2;
// Half diameter
int radius = diameter / 2;
if (cached_wheel_.width() != diameter || force_redraw_) {
cached_wheel_ = QPixmap(QSize(diameter, diameter));
@@ -71,7 +71,8 @@ void ColorWheelWidget::paintEvent(QPaintEvent *e)
Triangle tri = GetTriangleFromCoords(center, j, i);
if (tri.hypotenuse <= radius) {
QColor c = GetManagedColor(GetColorFromTriangle(tri)).toQColor();
Color managed = GetManagedColor(GetColorFromTriangle(tri));
QColor c = managed.toQColor();
// Very basic antialiasing around the edges of the wheel
qreal alpha = qMin(1.0, radius - tri.hypotenuse);