hack around caret problem in thebes builds (bug 312106)

This commit is contained in:
pavlov%pavlov.net 2006-02-07 07:08:37 +00:00
Родитель 4c9c041177
Коммит 0b0b40118a
1 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -657,15 +657,28 @@ nsThebesRenderingContext::FillRect(nscoord aX, nscoord aY, nscoord aWidth, nscoo
return NS_OK;
}
/**
* XXX awful invert rect hack
* idea by mrbkap
*/
static unsigned int gInvertRect = 0;
NS_IMETHODIMP
nsThebesRenderingContext::InvertRect(const nsRect& aRect)
{
gfxContext::GraphicsOperator lastOp = mThebes->CurrentOperator();
mThebes->SetOperator(gfxContext::OPERATOR_XOR);
gfxRGBA newColor(0,0,0,1);
if (gInvertRect++ % 2)
newColor = gfxRGBA(1,1,1,1);
mThebes->Save();
mThebes->SetColor(newColor);
mThebes->SetOperator(gfxContext::OPERATOR_OVER);
nsresult rv = FillRect(aRect);
mThebes->SetOperator(lastOp);
mThebes->Restore();
return rv;
}