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

Side by Side Diff: ui/views/animation/flood_fill_ink_drop_ripple.cc

Issue 2042073002: Centered flood fill style ink drop ripples on mouse/touch points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Polished for review. Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" 5 #include "ui/views/animation/flood_fill_ink_drop_ripple.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 gfx::Transform transform = gfx::Transform(); 309 gfx::Transform transform = gfx::Transform();
310 transform.Translate(center_point_.x() - root_layer_.bounds().x(), 310 transform.Translate(center_point_.x() - root_layer_.bounds().x(),
311 center_point_.y() - root_layer_.bounds().y()); 311 center_point_.y() - root_layer_.bounds().y());
312 transform.Scale(target_scale, target_scale); 312 transform.Scale(target_scale, target_scale);
313 transform.Translate(-drawn_center_point.x(), -drawn_center_point.y()); 313 transform.Translate(-drawn_center_point.x(), -drawn_center_point.y());
314 314
315 return transform; 315 return transform;
316 } 316 }
317 317
318 gfx::Transform FloodFillInkDropRipple::GetMaxSizeTargetTransform() const { 318 gfx::Transform FloodFillInkDropRipple::GetMaxSizeTargetTransform() const {
319 // TODO(estade): get rid of this 2, but make the fade out start before the 319 return CalculateTransform(
320 // active/action transform is done. 320 root_layer_.bounds().MaxDistanceToCorners(center_point_));
321 return CalculateTransform(gfx::Vector2dF(root_layer_.bounds().width(),
322 root_layer_.bounds().height())
323 .Length() /
324 2);
325 } 321 }
326 322
327 } // namespace views 323 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698