OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 |
| 5 #include <cmath> |
| 6 |
| 7 #include "content/public/common/page_zoom.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 const double kMinimumZoomFactor = 0.25; |
| 12 const double kMaximumZoomFactor = 5.0; |
| 13 |
| 14 bool ZoomValuesEqual(double value_a, double value_b) { |
| 15 // Epsilon value for comparing two floating-point zoom values. We don't use |
| 16 // std::numeric_limits<> because it is too precise for zoom values. Zoom |
| 17 // values lose precision due to factor/level conversions. A value of 0.001 |
| 18 // is precise enough for zoom value comparisons. |
| 19 const double epsilon = 0.001; |
| 20 |
| 21 return (std::fabs(value_a - value_b) <= epsilon); |
| 22 } |
| 23 |
| 24 } // namespace content |
| 25 |
OLD | NEW |