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

Unified Diff: ash/drag_drop/drag_image_view.cc

Issue 2016203002: Widget opacity goes from 0 to 1, not 0 to 255. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync 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 | ash/system/user/user_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/drag_drop/drag_image_view.cc
diff --git a/ash/drag_drop/drag_image_view.cc b/ash/drag_drop/drag_image_view.cc
index 97c0e18111f7bbf5414033f4166c954a477ce538..fb8a432906c24fa3d2e7284956617d77da20d294 100644
--- a/ash/drag_drop/drag_image_view.cc
+++ b/ash/drag_drop/drag_image_view.cc
@@ -28,7 +28,7 @@ Widget* CreateDragWidget(gfx::NativeView context) {
params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW;
drag_widget->Init(params);
- drag_widget->SetOpacity(0xFF);
+ drag_widget->SetOpacity(1.f);
drag_widget->GetNativeWindow()->set_owned_by_parent(false);
drag_widget->GetNativeWindow()->SetName("DragWidget");
SetShadowType(drag_widget->GetNativeView(), wm::SHADOW_TYPE_NONE);
@@ -99,7 +99,7 @@ void DragImageView::SetTouchDragOperationHintPosition(
void DragImageView::SetOpacity(float visibility) {
DCHECK_GE(visibility, 0.0f);
DCHECK_LE(visibility, 1.0f);
- widget_->SetOpacity(static_cast<int>(0xff * visibility));
+ widget_->SetOpacity(visibility);
}
void DragImageView::OnPaint(gfx::Canvas* canvas) {
« no previous file with comments | « no previous file | ash/system/user/user_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698