OLD | NEW |
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 Loading... |
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 |
OLD | NEW |