summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fb/fbpict.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fb/fbpict.c b/fb/fbpict.c
index 20d9ad559..ea45480b2 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -1265,30 +1265,34 @@ fbComposite (CARD8 op,
x_dst = pbox->x1;
if (maskRepeat)
{
- y_msk = mod (y_msk, pMask->pDrawable->height);
+ y_msk = mod (y_msk - pMask->pDrawable->y, pMask->pDrawable->height);
if (h_this > pMask->pDrawable->height - y_msk)
h_this = pMask->pDrawable->height - y_msk;
+ y_msk += pMask->pDrawable->y;
}
if (srcRepeat)
{
- y_src = mod (y_src, pSrc->pDrawable->height);
+ y_src = mod (y_src - pSrc->pDrawable->y, pSrc->pDrawable->height);
if (h_this > pSrc->pDrawable->height - y_src)
h_this = pSrc->pDrawable->height - y_src;
+ y_src += pSrc->pDrawable->y;
}
while (w)
{
w_this = w;
if (maskRepeat)
{
- x_msk = mod (x_msk, pMask->pDrawable->width);
+ x_msk = mod (x_msk - pMask->pDrawable->x, pMask->pDrawable->width);
if (w_this > pMask->pDrawable->width - x_msk)
w_this = pMask->pDrawable->width - x_msk;
+ x_msk += pMask->pDrawable->x;
}
if (srcRepeat)
{
- x_src = mod (x_src, pSrc->pDrawable->width);
+ x_src = mod (x_src - pSrc->pDrawable->x, pSrc->pDrawable->width);
if (w_this > pSrc->pDrawable->width - x_src)
w_this = pSrc->pDrawable->width - x_src;
+ x_src += pSrc->pDrawable->x;
}
(*func) (op, pSrc, pMask, pDst,
x_src, y_src, x_msk, y_msk, x_dst, y_dst,