mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
common/math: remove inlining
Let the compiler decide whether to inline.
This commit is contained in:
parent
87d85047aa
commit
11b756791b
2 changed files with 12 additions and 12 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue