diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-01-20 08:07:53 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-01-20 08:07:53 +0100 |
commit | 9c4c541bca8793aebafbff15cc0f8550b68bbb41 (patch) | |
tree | 95ca6175e63147f474a692166dfbb27670db919b /thirdparty/thorvg/src/lib/sw_engine/tvgSwRenderer.cpp | |
parent | 3e7f5ca8c2ab32987dcb6291b2786041ed56511e (diff) |
thorvg: Fix usage of min/max breaking on VS 2017
Fixes https://github.com/godotengine/godot/issues/56894#issuecomment-1015956706.
Diffstat (limited to 'thirdparty/thorvg/src/lib/sw_engine/tvgSwRenderer.cpp')
-rw-r--r-- | thirdparty/thorvg/src/lib/sw_engine/tvgSwRenderer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/thirdparty/thorvg/src/lib/sw_engine/tvgSwRenderer.cpp b/thirdparty/thorvg/src/lib/sw_engine/tvgSwRenderer.cpp index 78537e7726..c75e73760e 100644 --- a/thirdparty/thorvg/src/lib/sw_engine/tvgSwRenderer.cpp +++ b/thirdparty/thorvg/src/lib/sw_engine/tvgSwRenderer.cpp @@ -23,6 +23,7 @@ #include "tvgSwCommon.h" #include "tvgTaskScheduler.h" #include "tvgSwRenderer.h" +#include "tvgMath.h" /************************************************************************/ /* Internal Class Implementation */ @@ -594,10 +595,10 @@ void* SwRenderer::prepareCommon(SwTask* task, const RenderTransform* transform, task->surface = surface; task->mpool = mpool; task->flags = flags; - task->bbox.min.x = max(static_cast<SwCoord>(0), static_cast<SwCoord>(vport.x)); - task->bbox.min.y = max(static_cast<SwCoord>(0), static_cast<SwCoord>(vport.y)); - task->bbox.max.x = min(static_cast<SwCoord>(surface->w), static_cast<SwCoord>(vport.x + vport.w)); - task->bbox.max.y = min(static_cast<SwCoord>(surface->h), static_cast<SwCoord>(vport.y + vport.h)); + task->bbox.min.x = mathMax(static_cast<SwCoord>(0), static_cast<SwCoord>(vport.x)); + task->bbox.min.y = mathMax(static_cast<SwCoord>(0), static_cast<SwCoord>(vport.y)); + task->bbox.max.x = mathMin(static_cast<SwCoord>(surface->w), static_cast<SwCoord>(vport.x + vport.w)); + task->bbox.max.y = mathMin(static_cast<SwCoord>(surface->h), static_cast<SwCoord>(vport.y + vport.h)); if (!task->pushed) { task->pushed = true; |