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

Unified Diff: ui/gfx/transform_util.cc

Issue 694743002: Fix folder icon animation in app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@launcher_page_api_do_actual_thing
Patch Set: Created 6 years, 1 month 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
Index: ui/gfx/transform_util.cc
diff --git a/ui/gfx/transform_util.cc b/ui/gfx/transform_util.cc
index 655ce57f2bb2b799cbf7da1b69164d97e5a42dd0..37d3e538196e6bdff10d5fb5ccd61679bf57980e 100644
--- a/ui/gfx/transform_util.cc
+++ b/ui/gfx/transform_util.cc
@@ -282,6 +282,15 @@ Transform GetScaleTransform(const Point& anchor, float scale) {
return transform;
}
+Transform GetRectTransform(const gfx::Rect& from, const gfx::Rect& to) {
+ Transform transform;
+ transform.Translate(to.x(), to.y());
+ transform.Scale(static_cast<double>(to.width()) / from.width(),
Matt Giuca 2014/11/04 01:05:17 Going to have infinities if from.width() or from.h
calamity 2014/11/04 01:40:29 Done.
+ static_cast<double>(to.height()) / from.height());
+ transform.Translate(-from.x(), -from.y());
+ return transform;
+}
+
DecomposedTransform::DecomposedTransform() {
translate[0] = translate[1] = translate[2] = 0.0;
scale[0] = scale[1] = scale[2] = 1.0;

Powered by Google App Engine
This is Rietveld 408576698