fixed palette/tv-effects slider rounding issue

This commit is contained in:
thrust26 2020-06-09 08:27:14 +02:00
parent b93ea1c837
commit 8483b6d160
2 changed files with 3 additions and 3 deletions

View File

@ -126,7 +126,7 @@ class PaletteHandler
Convert adjustables from/to 100% scale
*/
static constexpr float scaleFrom100(float x) { return (x / 50.F) - 1.F; }
static constexpr uInt32 scaleTo100(float x) { return uInt32(50 * (x + 1.F)); }
static constexpr uInt32 scaleTo100(float x) { return uInt32(50.0001F * (x + 1.F)); }
/**
Convert palette settings name to enumeration.

View File

@ -20,8 +20,8 @@
#include "NTSCFilter.hxx"
constexpr float scaleFrom100(float x) { return (x/50.F) - 1.F; }
constexpr uInt32 scaleTo100(float x) { return uInt32(50*(x+1.F)); }
constexpr float scaleFrom100(float x) { return (x / 50.F) - 1.F; }
constexpr uInt32 scaleTo100(float x) { return uInt32(50.0001F * (x + 1.F)); }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string NTSCFilter::setPreset(Preset preset)