Index: ui/gfx/geometry/vector3d_f.h |
diff --git a/ui/gfx/geometry/vector3d_f.h b/ui/gfx/geometry/vector3d_f.h |
index 4e0eaa412492205b14e8ddb63a1d60c9cee4c15b..f6c23044d5a41b571e2d9329a27db8f4a12ef11e 100644 |
--- a/ui/gfx/geometry/vector3d_f.h |
+++ b/ui/gfx/geometry/vector3d_f.h |
@@ -20,18 +20,19 @@ namespace gfx { |
class GFX_EXPORT Vector3dF { |
public: |
- Vector3dF(); |
- Vector3dF(float x, float y, float z); |
+ constexpr Vector3dF() : x_(0), y_(0), z_(0) {} |
+ constexpr Vector3dF(float x, float y, float z) : x_(x), y_(y), z_(z) {} |
- explicit Vector3dF(const Vector2dF& other); |
+ constexpr explicit Vector3dF(const Vector2dF& other) |
+ : x_(other.x()), y_(other.y()), z_(0) {} |
- float x() const { return x_; } |
+ constexpr float x() const { return x_; } |
void set_x(float x) { x_ = x; } |
- float y() const { return y_; } |
+ constexpr float y() const { return y_; } |
void set_y(float y) { y_ = y; } |
- float z() const { return z_; } |
+ constexpr float z() const { return z_; } |
void set_z(float z) { z_ = z; } |
// True if all components of the vector are 0. |