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

Side by Side Diff: ui/gfx/geometry/scroll_offset.cc

Issue 584503005: Make scroll offset type of float in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: blow up the patchset :( Created 6 years, 2 months 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
OLDNEW
(Empty)
1 // Copyright 2014 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 "ui/gfx/geometry/scroll_offset.h"
6
7 #include "base/strings/stringprintf.h"
8
9 namespace gfx {
10
11 std::string ScrollOffset::ToString() const {
danakj 2014/09/27 00:00:44 nit: move to bottom like it is ordered in .cc
Yufeng Shen (Slow to review) 2014/09/29 19:27:34 with the 3 methods below moved into .cc, the order
12 return base::StringPrintf("[%lf %lf]", x_, y_);
13 }
14
15 bool ScrollOffset::IsZero() const {
danakj 2014/09/27 00:00:44 these 3 method are all trivial, can you move them
Yufeng Shen (Slow to review) 2014/09/29 19:27:34 Done.
16 return x_ == 0 && y_ == 0;
17 }
18
19 void ScrollOffset::Add(const ScrollOffset& other) {
20 x_ += other.x_;
21 y_ += other.y_;
22 }
23
24 void ScrollOffset::Subtract(const ScrollOffset& other) {
25 x_ -= other.x_;
26 y_ -= other.y_;
27 }
28
29 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698