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

Side by Side Diff: content/public/common/page_zoom.cc

Issue 8528011: Page zoom improvements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix comment spelling mistake Created 9 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
jam 2011/11/21 22:20:54 nit: sorry i should have said this earlier, wasn't
csilv 2011/11/22 00:10:59 Done.
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698