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

Unified Diff: ui/gfx/geometry/scroll_offset.h

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/geometry/scroll_offset.h
diff --git a/ui/gfx/geometry/scroll_offset.h b/ui/gfx/geometry/scroll_offset.h
index f882c1b51af0d4535bd580977d68b73a30fac8de..cc0d360c3406b3bd2c5465718a2fe2b75b45ad7e 100644
--- a/ui/gfx/geometry/scroll_offset.h
+++ b/ui/gfx/geometry/scroll_offset.h
@@ -17,15 +17,15 @@ namespace gfx {
class GFX_EXPORT ScrollOffset {
public:
ScrollOffset() : x_(0), y_(0) {}
- ScrollOffset(double x, double y) : x_(x), y_(y) {}
+ ScrollOffset(float x, float y) : x_(x), y_(y) {}
explicit ScrollOffset(const Vector2dF& v) : x_(v.x()), y_(v.y()) {}
explicit ScrollOffset(const Vector2d& v) : x_(v.x()), y_(v.y()) {}
- double x() const { return x_; }
- void set_x(double x) { x_ = x; }
+ float x() const { return x_; }
+ void set_x(float x) { x_ = x; }
- double y() const { return y_; }
- void set_y(double y) { y_ = y; }
+ float y() const { return y_; }
+ void set_y(float y) { y_ = y; }
// True if both components are 0.
bool IsZero() const {
@@ -62,8 +62,8 @@ class GFX_EXPORT ScrollOffset {
y_ = y_ >= other.y_ ? y_ : other.y_;
}
- void Scale(double scale) { Scale(scale, scale); }
- void Scale(double x_scale, double y_scale) {
+ void Scale(float scale) { Scale(scale, scale); }
+ void Scale(float x_scale, float y_scale) {
x_ *= x_scale;
y_ *= y_scale;
}
@@ -71,8 +71,8 @@ class GFX_EXPORT ScrollOffset {
std::string ToString() const;
private:
- double x_;
- double y_;
+ float x_;
+ float y_;
bokan 2016/10/02 19:47:51 So did we decide that we don't care about the mons
danakj 2016/10/03 21:24:41 See the bug for how we got here :)
};
inline bool operator==(const ScrollOffset& lhs, const ScrollOffset& rhs) {

Powered by Google App Engine
This is Rietveld 408576698