mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
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:
parent
ed3608b39b
commit
59399e8597
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue