mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
wasm: fix compile errors.
This commit is contained in:
parent
352f843d2b
commit
d2c04f6037
4 changed files with 13 additions and 10 deletions
|
@ -458,10 +458,10 @@ bool mathUpdateOutlineBBox(const SwOutline* outline, const SwBBox& clipRegion, S
|
|||
renderRegion.min.y = yMin >> 6;
|
||||
renderRegion.max.y = (yMax + 63) >> 6;
|
||||
|
||||
renderRegion.max.x = min(renderRegion.max.x, clipRegion.max.x);
|
||||
renderRegion.max.y = min(renderRegion.max.y, clipRegion.max.y);
|
||||
renderRegion.min.x = max(renderRegion.min.x, clipRegion.min.x);
|
||||
renderRegion.min.y = max(renderRegion.min.y, clipRegion.min.y);
|
||||
renderRegion.max.x = (renderRegion.max.x < clipRegion.max.x) ? renderRegion.max.x : clipRegion.max.x;
|
||||
renderRegion.max.y = (renderRegion.max.y < clipRegion.max.y) ? renderRegion.max.y : clipRegion.max.y;
|
||||
renderRegion.min.x = (renderRegion.min.x > clipRegion.min.x) ? renderRegion.min.x : clipRegion.min.x;
|
||||
renderRegion.min.y = (renderRegion.min.y > clipRegion.min.y) ? renderRegion.min.y : clipRegion.min.y;
|
||||
|
||||
//Check valid region
|
||||
if (renderRegion.max.x - renderRegion.min.x < 1 && renderRegion.max.y - renderRegion.min.y < 1) return false;
|
||||
|
@ -471,4 +471,4 @@ bool mathUpdateOutlineBBox(const SwOutline* outline, const SwBBox& clipRegion, S
|
|||
renderRegion.max.x <= clipRegion.min.x || renderRegion.max.y <= clipRegion.min.y) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,10 +56,10 @@ struct RenderRegion {
|
|||
auto x2 = rhs.x + rhs.w;
|
||||
auto y2 = rhs.y + rhs.h;
|
||||
|
||||
x = max(x, rhs.x);
|
||||
y = max(y, rhs.y);
|
||||
w = min(x1, x2) - x;
|
||||
h = min(y1, y2) - y;
|
||||
x = (x > rhs.x) ? x : rhs.x;
|
||||
y = (y > rhs.y) ? y : rhs.y;
|
||||
w = ((x1 < x2) ? x1 : x2) - x;
|
||||
h = ((y1 < y2) ? y1 : y2) - y;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
#include <math.h>
|
||||
#include <clocale>
|
||||
#include <ctype.h>
|
||||
#include "tvgSvgLoaderCommon.h"
|
||||
#include "tvgSvgPath.h"
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
#include <math.h>
|
||||
#include <string>
|
||||
#include "tvgSvgLoaderCommon.h"
|
||||
#include "tvgSvgSceneBuilder.h"
|
||||
#include "tvgSvgPath.h"
|
||||
|
@ -427,4 +428,4 @@ unique_ptr<Scene> svgSceneBuild(SvgNode* node)
|
|||
root = move(docNode);
|
||||
}
|
||||
return root;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue