diff --git a/src/renderer/tvgPaint.cpp b/src/renderer/tvgPaint.cpp index 63db2043..4101a3fd 100644 --- a/src/renderer/tvgPaint.cpp +++ b/src/renderer/tvgPaint.cpp @@ -119,10 +119,10 @@ static Result _compFastTrack(RenderMethod* renderer, Paint* cmpTarget, const Mat if (v1.x > v2.x) std::swap(v1.x, v2.x); if (v1.y > v2.y) std::swap(v1.y, v2.y); - after.x = static_cast(v1.x); - after.y = static_cast(v1.y); - after.w = static_cast(ceil(v2.x - after.x)); - after.h = static_cast(ceil(v2.y - after.y)); + after.x = static_cast(nearbyint(v1.x)); + after.y = static_cast(nearbyint(v1.y)); + after.w = static_cast(nearbyint(v2.x)) - after.x; + after.h = static_cast(nearbyint(v2.y)) - after.y; if (after.w < 0) after.w = 0; if (after.h < 0) after.h = 0;