Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1238)

Unified Diff: chrome/browser/ui/views/download/download_started_animation_views.cc

Issue 2009333002: Converts Widget::SetOpacity from char to float (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/exclusive_access_bubble_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/download/download_started_animation_views.cc
diff --git a/chrome/browser/ui/views/download/download_started_animation_views.cc b/chrome/browser/ui/views/download/download_started_animation_views.cc
index 20bd3cd18149355b27181e2637814e3a273581cb..458d91f90de1f27bbd2c1d36c2dd932d2f65c009 100644
--- a/chrome/browser/ui/views/download/download_started_animation_views.cc
+++ b/chrome/browser/ui/views/download/download_started_animation_views.cc
@@ -113,10 +113,8 @@ void DownloadStartedAnimationViews::AnimateToState(double state) {
Reposition();
// Start at zero, peak halfway and end at zero.
- double opacity = std::min(1.0 - pow(GetCurrentValue() - 0.5, 2) * 4.0,
- static_cast<double>(1.0));
-
- popup_->SetOpacity(static_cast<unsigned char>(opacity * 255.0));
+ popup_->SetOpacity(static_cast<float>(
+ std::min(1.0 - pow(GetCurrentValue() - 0.5, 2) * 4.0, 1.0)));
}
}
« no previous file with comments | « no previous file | chrome/browser/ui/views/exclusive_access_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698