common/math: remove inlining

Let the compiler decide whether to inline.
This commit is contained in:
Hermet Park 2024-08-23 14:41:02 +09:00
parent 87d85047aa
commit 11b756791b
2 changed files with 12 additions and 12 deletions

View file

@ -212,6 +212,17 @@ Point operator*(const Point& pt, const Matrix& m)
}
Point normal(const Point& p1, const Point& p2)
{
auto dir = p2 - p1;
auto len = length(dir);
if (tvg::zero(len)) return {};
auto unitDir = dir / len;
return {-unitDir.y, unitDir.x};
}
float Line::length() const
{
return _lineLength(pt1, pt2);

View file

@ -165,7 +165,7 @@ static inline void log(const Matrix& m)
void operator*=(Point& pt, const Matrix& m);
Point operator*(const Point& pt, const Matrix& m);
Point normal(const Point& p1, const Point& p2);
static inline bool zero(const Point& p)
{
@ -233,17 +233,6 @@ static inline Point operator/(const Point& lhs, const float rhs)
}
static inline Point normal(const Point& p1, const Point& p2)
{
auto dir = p2 - p1;
auto len = length(dir);
if (tvg::zero(len)) return {};
auto unitDir = dir / len;
return {-unitDir.y, unitDir.x};
}
static inline void log(const Point& pt)
{
TVGLOG("COMMON", "Point: [%f %f]", pt.x, pt.y);