UI: Fix precision in float comparison helper

Use std::abs instead of abs to avoid loss in precision and also fix
the corresponding warning from clang (3.5.0):

warning: using integer absolute value function 'abs' when argument is
of floating point type [-Wabsolute-value]

Closes jp9000/obs-studio#414
This commit is contained in:
fryshorts 2015-04-07 22:15:33 +02:00 committed by Palana
parent 917daff6ec
commit 9cc56f2516

View File

@ -59,6 +59,7 @@ static bool SceneItemHasVideo(obs_sceneitem_t *item)
static bool CloseFloat(float a, float b, float epsilon=0.01)
{
using std::abs;
return abs(a-b) <= epsilon;
}