Fix narrowing conversions
This commit is contained in:
@@ -104,7 +104,7 @@ void MoodbarBuilder::Normalize(QList<Rgb> *vals, double Rgb::*member) {
|
||||
for (const Rgb &rgb : *vals) {
|
||||
const double value = rgb.*member;
|
||||
if (value != mini && value != maxi) {
|
||||
avg += value / vals->count();
|
||||
avg += value / static_cast<double>(vals->count());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ void MoodbarRenderer::Render(const ColorVector &colors, QPainter *p, const QRect
|
||||
int start = static_cast<int>(x * colors.size() / rect.width());
|
||||
int end = static_cast<int>((x + 1) * colors.size() / rect.width());
|
||||
|
||||
if (start == end) end = qMin(start + 1, colors.size() - 1);
|
||||
if (start == end) end = qMin(start + 1, static_cast<int>(colors.size() - 1));
|
||||
|
||||
for (int j = start; j < end; j++) {
|
||||
r += colors[j].red();
|
||||
|
||||
Reference in New Issue
Block a user