зеркало из https://github.com/mozilla/gecko-dev.git
Implement InvertRect on Mac. r sfraser
This commit is contained in:
Родитель
e61205fb16
Коммит
0621f4050e
|
@ -1397,10 +1397,26 @@ NS_IMETHODIMP nsRenderingContextMac::RetrieveCurrentNativeGraphicData(PRUint32 *
|
|||
|
||||
NS_IMETHODIMP nsRenderingContextMac::InvertRect(const nsRect& aRect)
|
||||
{
|
||||
return NS_OK;
|
||||
return InvertRect(aRect.x, aRect.y, aRect.width, aRect.height);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsRenderingContextMac::InvertRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight)
|
||||
{
|
||||
return NS_OK;
|
||||
StartDraw();
|
||||
|
||||
nscoord x,y,w,h;
|
||||
Rect therect;
|
||||
|
||||
x = aX;
|
||||
y = aY;
|
||||
w = aWidth;
|
||||
h = aHeight;
|
||||
|
||||
mGS->mTMatrix.TransformCoord(&x, &y, &w, &h);
|
||||
::SetRect(&therect, pinToShort(x), pinToShort(y), pinToShort(x + w), pinToShort(y + h));
|
||||
::InvertRect(&therect);
|
||||
|
||||
EndDraw();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -871,7 +871,7 @@ nsTextFrame::PaintTextDecorations(nsIRenderingContext& aRenderingContext,
|
|||
//
|
||||
// For platforms that dont implement InvertRect(), the selection will be
|
||||
// a non-filled rectangle.
|
||||
#if defined(XP_PC) || defined(XP_UNIX)
|
||||
#if defined(XP_PC) || defined(XP_UNIX) || defined(XP_MAC)
|
||||
aRenderingContext.SetColor(NS_RGB(255,255,255));
|
||||
aRenderingContext.InvertRect(aX + startOffset, aY, textWidth, rect.height);
|
||||
#else
|
||||
|
|
|
@ -871,7 +871,7 @@ nsTextFrame::PaintTextDecorations(nsIRenderingContext& aRenderingContext,
|
|||
//
|
||||
// For platforms that dont implement InvertRect(), the selection will be
|
||||
// a non-filled rectangle.
|
||||
#if defined(XP_PC) || defined(XP_UNIX)
|
||||
#if defined(XP_PC) || defined(XP_UNIX) || defined(XP_MAC)
|
||||
aRenderingContext.SetColor(NS_RGB(255,255,255));
|
||||
aRenderingContext.InvertRect(aX + startOffset, aY, textWidth, rect.height);
|
||||
#else
|
||||
|
|
Загрузка…
Ссылка в новой задаче