mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
wg_engine: use tvg math constants
Use tvg pi constant instead of cmath. better mingw compiler support on windows
This commit is contained in:
parent
98700ed2d2
commit
b851d98805
1 changed files with 1 additions and 1 deletions
|
@ -348,7 +348,7 @@ struct WgVertexBufferInd
|
||||||
float cosine = dot(nrm, nrm1);
|
float cosine = dot(nrm, nrm1);
|
||||||
if (tvg::zero(cosine)) return;
|
if (tvg::zero(cosine)) return;
|
||||||
float angle = std::acos(dot(nrm1, -nrm2));
|
float angle = std::acos(dot(nrm1, -nrm2));
|
||||||
if (tvg::zero(angle) || tvg::equal(angle, M_PI)) return;
|
if (tvg::zero(angle) || tvg::equal(angle, MATH_PI)) return;
|
||||||
float miterRatio = 1.0f / (std::sin(angle) * 0.5f);
|
float miterRatio = 1.0f / (std::sin(angle) * 0.5f);
|
||||||
if (miterRatio <= miterLimit) {
|
if (miterRatio <= miterLimit) {
|
||||||
appendQuad(v1 + nrm * (halfWidth / cosine), v1 + offset2, v1 + offset1, v1);
|
appendQuad(v1 + nrm * (halfWidth / cosine), v1 + offset2, v1 + offset1, v1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue