scale_utility.cc 520 B

123456789101112131415161718
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/public/cpp/scale_utility.h"
  5. #include "ui/gfx/geometry/transform.h"
  6. #include "ui/gfx/geometry/transform_util.h"
  7. namespace ash {
  8. float GetScaleFactorForTransform(const gfx::Transform& transform) {
  9. gfx::DecomposedTransform decomposed;
  10. gfx::DecomposeTransform(&decomposed, transform);
  11. return decomposed.scale[0];
  12. }
  13. } // namespace ash