updated the invalidate method

This commit is contained in:
dcone%netscape.com 1998-10-09 15:18:26 +00:00
parent 61b4870db2
commit a2b1bb00cb
2 changed files with 28 additions and 1 deletions

View File

@ -721,7 +721,33 @@ NS_IMETHODIMP nsWindow::SetCursor(nsCursor aCursor)
{
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Invalidate this component visible area
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsWindow::Invalidate(const nsRect &aRect, PRBool aIsSynchronous)
{
GrafPtr curport;
RgnHandle thergn;
if(mWindowRegion)
{
::GetPort(&curport);
::SetPort(mWindowPtr);
thergn = ::NewRgn();
::SetRectRgn(thergn,aRect.x,aRect.y,aRect.x+aRect.width,aRect.y+aRect.height);
::SectRgn(thergn,mWindowRegion,thergn);
::InvalRgn(thergn);
::DisposeRgn(thergn);
::SetPort(curport);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Invalidate this component visible area

View File

@ -91,6 +91,7 @@ public:
virtual nsCursor GetCursor();
NS_IMETHOD SetCursor(nsCursor aCursor);
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
NS_IMETHOD Invalidate(const nsRect &aRect,PRBool aIsSynchronous);
virtual void* GetNativeData(PRUint32 aDataType);
virtual nsIRenderingContext* GetRenderingContext();
NS_IMETHOD SetColorMap(nsColorMap *aColorMap);