mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1225137 - Avoid crash on some platforms if scrollbar fading is enabled and the duration is set to zero. r=spohl
This commit is contained in:
parent
145a6397e3
commit
aa47c05732
@ -363,7 +363,11 @@ SetOpacityOnElement(nsIContent* aContent, double aOpacity)
|
||||
bool
|
||||
ScrollbarActivity::UpdateOpacity(TimeStamp aTime)
|
||||
{
|
||||
double progress = (aTime - mFadeBeginTime) / FadeDuration();
|
||||
// Avoid division by zero if mScrollbarFadeDuration is zero, just jump
|
||||
// to the end of the fade animation
|
||||
double progress = mScrollbarFadeDuration
|
||||
? ((aTime - mFadeBeginTime) / FadeDuration())
|
||||
: 1.0;
|
||||
double opacity = 1.0 - std::max(0.0, std::min(1.0, progress));
|
||||
|
||||
// 'this' may be getting destroyed during SetOpacityOnElement calls.
|
||||
|
Loading…
Reference in New Issue
Block a user