Skip to content

Commit

Permalink
CID 248939: Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
Browse files Browse the repository at this point in the history
integer_division: Dividing integer expressions 255 and 100, and then
converting the integer quotient to type double. Any remainder, or
fractional part of the quotient, is ignored.
  • Loading branch information
hallarempt committed Sep 26, 2019
1 parent 8129995 commit 1a24947
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/ui/widgets/kis_paintop_preset_icon_library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ QImage KisPaintopPresetIconLibrary::hueTransform(QImage img)
if (hue > 360) {
hue -= 360;
}
int sat = qMax(qMin(c.hslSaturation()+int(ui->sldSat->value() * (255/100)), 255), 0);
int sat = qMax(qMin(c.hslSaturation() + int(ui->sldSat->value() * (255.0 / 100.0)), 255), 0);
c.setHsl(hue, sat, values.at(c.lightness()), c.alpha());
img.setPixelColor(x, y, c);
}
Expand Down

0 comments on commit 1a24947

Please sign in to comment.