Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
vector2d_conversions.cc
Go to the documentation of this file.
1// Copyright (c) 2012 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
6
8
9namespace gfx {
10
12 return Vector2d(base::ClampFloor(vector2d.x()),
13 base::ClampFloor(vector2d.y()));
14}
15
17 return Vector2d(base::ClampCeil(vector2d.x()), base::ClampCeil(vector2d.y()));
18}
19
21 return Vector2d(base::ClampRound(vector2d.x()),
22 base::ClampRound(vector2d.y()));
23}
24
25} // namespace gfx
constexpr float y() const
Definition vector2d_f.h:29
constexpr float x() const
Definition vector2d_f.h:26
Dst ClampFloor(Src value)
Dst ClampCeil(Src value)
Dst ClampRound(Src value)
Definition insets.cc:10
Vector2d ToFlooredVector2d(const Vector2dF &vector2d)
Vector2d ToCeiledVector2d(const Vector2dF &vector2d)
Vector2d ToRoundedVector2d(const Vector2dF &vector2d)