mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix double to int truncation in C++ code
Wfloat-conversion enabled for C++ part of the code Fix warnings raised by the flag using lrint Original issue reported on the mailing list: The ascent/descent rates are sometimes not what is expected. E.g. setting the ascent rate to 10m/min results in an actual ascent rate of 9m/min. This is due to truncating the ascent rate preference, then effectively rounding up the time to reach each stop to 2s intervals. The result being that setting the ascent rate to 10m/min results in 20s to ascend 3m (9m/min), when it should be exactly 18s. Reported-by: John Smith <noseygit@hotmail.com> Reported-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
This commit is contained in:
parent
d83449f3b5
commit
597539ce39
25 changed files with 73 additions and 72 deletions
|
@ -526,18 +526,18 @@ print_part:
|
|||
if (option.state & QStyle::State_Selected) {
|
||||
painter->setPen(QPen(opt.palette.highlight().color().darker()));
|
||||
painter->setBrush(opt.palette.highlight());
|
||||
const qreal pad = 1.0;
|
||||
const qreal pad2 = pad * 2.0;
|
||||
const qreal rounding = 5.0;
|
||||
const int pad = 1;
|
||||
const int pad2 = pad * 2;
|
||||
const int rounding = 5;
|
||||
painter->drawRoundedRect(option.rect.x() + pad,
|
||||
option.rect.y() + pad,
|
||||
option.rect.width() - pad2,
|
||||
option.rect.height() - pad2,
|
||||
rounding, rounding);
|
||||
option.rect.y() + pad,
|
||||
option.rect.width() - pad2,
|
||||
option.rect.height() - pad2,
|
||||
rounding, rounding);
|
||||
}
|
||||
painter->setPen(textPen);
|
||||
painter->setFont(fontBigger);
|
||||
const qreal textPad = 5.0;
|
||||
const int textPad = 5;
|
||||
painter->drawText(option.rect.x() + textPad, option.rect.y() + fmBigger.boundingRect("YH").height(), diveSiteName);
|
||||
double pointSize = fontSmaller.pointSizeF();
|
||||
fontSmaller.setPointSizeF(0.9 * pointSize);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue