mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1122631 - Fix wrong logic in DrawTargetTiled::CopySurface. r=jrmuizel
This commit is contained in:
parent
71ad39a7e7
commit
bc8f416df2
@ -178,19 +178,14 @@ DrawTargetTiled::CopySurface(SourceSurface *aSurface,
|
||||
const IntRect &aSourceRect,
|
||||
const IntPoint &aDestination)
|
||||
{
|
||||
// CopySurface ignores the transform, account for that here.
|
||||
for (size_t i = 0; i < mTiles.size(); i++) {
|
||||
IntRect src = aSourceRect;
|
||||
src.x += mTiles[i].mTileOrigin.x;
|
||||
src.width -= mTiles[i].mTileOrigin.x;
|
||||
src.y = mTiles[i].mTileOrigin.y;
|
||||
src.height -= mTiles[i].mTileOrigin.y;
|
||||
|
||||
if (src.width <= 0 || src.height <= 0) {
|
||||
IntPoint tileOrigin = mTiles[i].mTileOrigin;
|
||||
IntSize tileSize = mTiles[i].mDrawTarget->GetSize();
|
||||
if (!IntRect(aDestination, aSourceRect.Size()).Intersects(IntRect(tileOrigin, tileSize))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
mTiles[i].mDrawTarget->CopySurface(aSurface, src, aDestination);
|
||||
// CopySurface ignores the transform, account for that here.
|
||||
mTiles[i].mDrawTarget->CopySurface(aSurface, aSourceRect, aDestination - tileOrigin);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user