Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |