common: viewport values improperly rounded

For a very specific scaling factors shapes were to much clipped
because of wrong rounding of the viewport.
This commit is contained in:
mgrudzinska 2022-02-27 02:24:18 +01:00 committed by Hermet Park
parent ed3608b39b
commit 59399e8597

View file

@ -79,8 +79,8 @@ static bool _compFastTrack(Paint* cmpTarget, const RenderTransform* pTransform,
viewport.x = static_cast<int32_t>(v1.x);
viewport.y = static_cast<int32_t>(v1.y);
viewport.w = static_cast<int32_t>(v2.x - v1.x + 0.5f);
viewport.h = static_cast<int32_t>(v2.y - v1.y + 0.5f);
viewport.w = static_cast<int32_t>(ceil(v2.x - viewport.x));
viewport.h = static_cast<int32_t>(ceil(v2.y - viewport.y));
if (viewport.w < 0) viewport.w = 0;
if (viewport.h < 0) viewport.h = 0;
@ -404,4 +404,4 @@ uint8_t Paint::opacity() const noexcept
uint32_t Paint::identifier() const noexcept
{
return pImpl->id;
}
}