From d8f18ce4e425ac009fa3edc8df4b3eb5f4776a54 Mon Sep 17 00:00:00 2001 From: "michaelp%netscape.com" Date: Tue, 3 Nov 1998 01:49:30 +0000 Subject: [PATCH] fixed bug where changing view opacity or transparency would not trigger a refresh. git-svn-id: svn://10.0.0.236/trunk@13948 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/view/src/nsViewManager.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp index 925f0ebb77b..8c914a6be17 100644 --- a/mozilla/view/src/nsViewManager.cpp +++ b/mozilla/view/src/nsViewManager.cpp @@ -1068,18 +1068,34 @@ NS_IMETHODIMP nsViewManager :: GetViewClipAbsolute(nsIView *aView, nsRect *rect, NS_IMETHODIMP nsViewManager :: SetViewContentTransparency(nsIView *aView, PRBool aTransparent) { - UpdateTransCnt(aView, nsnull); - aView->SetContentTransparency(aTransparent); - UpdateTransCnt(nsnull, aView); + PRBool trans; + + aView->HasTransparency(trans); + + if (trans != aTransparent) + { + UpdateTransCnt(aView, nsnull); + aView->SetContentTransparency(aTransparent); + UpdateTransCnt(nsnull, aView); + UpdateView(aView, nsnull, 0); + } return NS_OK; } NS_IMETHODIMP nsViewManager :: SetViewOpacity(nsIView *aView, float aOpacity) { - UpdateTransCnt(aView, nsnull); - aView->SetOpacity(aOpacity); - UpdateTransCnt(nsnull, aView); + float opacity; + + aView->GetOpacity(opacity); + + if (opacity != aOpacity) + { + UpdateTransCnt(aView, nsnull); + aView->SetOpacity(aOpacity); + UpdateTransCnt(nsnull, aView); + UpdateView(aView, nsnull, 0); + } return NS_OK; }