Remove typeInfo struct from lmms_basics.h (#7380)

* remove typeInfo struct from lmms_basics.h

* Code review

Co-authored-by: saker <sakertooth@gmail.com>

* converted epsilon to a constant

* renamed to approximatelyEqual and moved to top

---------

Co-authored-by: saker <sakertooth@gmail.com>
This commit is contained in:
Rossmaxx
2024-08-07 07:33:10 +05:30
committed by GitHub
parent c16616cca4
commit 828cefb4ea
11 changed files with 19 additions and 61 deletions

View File

@@ -31,6 +31,7 @@
#include "embed.h"
#include "Engine.h"
#include "lmms_constants.h"
#include "lmms_math.h"
namespace lmms::gui
@@ -65,7 +66,7 @@ QRectF EqHandle::boundingRect() const
float EqHandle::freqToXPixel( float freq , int w )
{
if (typeInfo<float>::isEqual(freq, 0.0f)) { return 0.0f; }
if (approximatelyEqual(freq, 0.0f)) { return 0.0f; }
float min = log10f( 20 );
float max = log10f( 20000 );
float range = max - min;