mirror of
https://github.com/opentx/opentx.git
synced 2025-07-17 21:35:27 +03:00
Fixes #3156: Outputs Subtrim, Min and Max values rounding problem fixed (ported from master)
This commit is contained in:
parent
d734e3465d
commit
117e28db16
2 changed files with 6 additions and 2 deletions
|
@ -175,7 +175,7 @@ void GVarGroup::valuesChanged()
|
||||||
else if (sb)
|
else if (sb)
|
||||||
weight = sb->value();
|
weight = sb->value();
|
||||||
else
|
else
|
||||||
weight = dsb->value()/step;
|
weight = round(dsb->value()/step);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,13 @@
|
||||||
#define FORCEINLINE inline
|
#define FORCEINLINE inline
|
||||||
#define NOINLINE
|
#define NOINLINE
|
||||||
|
|
||||||
#define round(x) floor(x+0.5)
|
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
#define strncasecmp _tcsnicmp
|
#define strncasecmp _tcsnicmp
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
|
||||||
|
inline double round(double number)
|
||||||
|
{
|
||||||
|
return number < 0.0 ? ceil(number - 0.5) : floor(number + 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue