Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
gfx::InsetsF Class Reference

#include <insets_f.h>

Public Member Functions

constexpr InsetsF ()
 
constexpr InsetsF (float all)
 
constexpr InsetsF (float vertical, float horizontal)
 
constexpr InsetsF (float top, float left, float bottom, float right)
 
constexpr float top () const
 
constexpr float left () const
 
constexpr float bottom () const
 
constexpr float right () const
 
constexpr float width () const
 
constexpr float height () const
 
bool IsEmpty () const
 
void Set (float top, float left, float bottom, float right)
 
bool operator== (const InsetsF &insets) const
 
bool operator!= (const InsetsF &insets) const
 
void operator+= (const InsetsF &insets)
 
void operator-= (const InsetsF &insets)
 
InsetsF operator- () const
 
InsetsF Scale (float scale) const
 
std::string ToString () const
 

Detailed Description

Definition at line 15 of file insets_f.h.

Constructor & Destructor Documentation

◆ InsetsF() [1/4]

constexpr gfx::InsetsF::InsetsF ( )
inlineconstexpr

Definition at line 17 of file insets_f.h.

17: top_(0.f), left_(0.f), bottom_(0.f), right_(0.f) {}

◆ InsetsF() [2/4]

constexpr gfx::InsetsF::InsetsF ( float  all)
inlineexplicitconstexpr

Definition at line 18 of file insets_f.h.

19 : top_(all), left_(all), bottom_(all), right_(all) {}

◆ InsetsF() [3/4]

constexpr gfx::InsetsF::InsetsF ( float  vertical,
float  horizontal 
)
inlineconstexpr

Definition at line 20 of file insets_f.h.

21 : top_(vertical),
22 left_(horizontal),
23 bottom_(vertical),
24 right_(horizontal) {}

◆ InsetsF() [4/4]

constexpr gfx::InsetsF::InsetsF ( float  top,
float  left,
float  bottom,
float  right 
)
inlineconstexpr

Definition at line 25 of file insets_f.h.

26 : top_(top), left_(left), bottom_(bottom), right_(right) {}
constexpr float left() const
Definition insets_f.h:29
constexpr float bottom() const
Definition insets_f.h:30
constexpr float top() const
Definition insets_f.h:28
constexpr float right() const
Definition insets_f.h:31

Member Function Documentation

◆ bottom()

constexpr float gfx::InsetsF::bottom ( ) const
inlineconstexpr

Definition at line 30 of file insets_f.h.

30{ return bottom_; }

◆ height()

constexpr float gfx::InsetsF::height ( ) const
inlineconstexpr

Definition at line 39 of file insets_f.h.

39{ return top_ + bottom_; }

◆ IsEmpty()

bool gfx::InsetsF::IsEmpty ( ) const
inline

Definition at line 42 of file insets_f.h.

42{ return width() == 0.f && height() == 0.f; }
constexpr float height() const
Definition insets_f.h:39
constexpr float width() const
Definition insets_f.h:35

◆ left()

constexpr float gfx::InsetsF::left ( ) const
inlineconstexpr

Definition at line 29 of file insets_f.h.

29{ return left_; }

◆ operator!=()

bool gfx::InsetsF::operator!= ( const InsetsF insets) const
inline

Definition at line 56 of file insets_f.h.

56{ return !(*this == insets); }

◆ operator+=()

void gfx::InsetsF::operator+= ( const InsetsF insets)
inline

Definition at line 58 of file insets_f.h.

58 {
59 top_ += insets.top_;
60 left_ += insets.left_;
61 bottom_ += insets.bottom_;
62 right_ += insets.right_;
63 }

◆ operator-()

InsetsF gfx::InsetsF::operator- ( ) const
inline

Definition at line 72 of file insets_f.h.

72 {
73 return InsetsF(-top_, -left_, -bottom_, -right_);
74 }
constexpr InsetsF()
Definition insets_f.h:17

◆ operator-=()

void gfx::InsetsF::operator-= ( const InsetsF insets)
inline

Definition at line 65 of file insets_f.h.

65 {
66 top_ -= insets.top_;
67 left_ -= insets.left_;
68 bottom_ -= insets.bottom_;
69 right_ -= insets.right_;
70 }

◆ operator==()

bool gfx::InsetsF::operator== ( const InsetsF insets) const
inline

Definition at line 51 of file insets_f.h.

51 {
52 return top_ == insets.top_ && left_ == insets.left_ &&
53 bottom_ == insets.bottom_ && right_ == insets.right_;
54 }

◆ right()

constexpr float gfx::InsetsF::right ( ) const
inlineconstexpr

Definition at line 31 of file insets_f.h.

31{ return right_; }

◆ Scale()

InsetsF gfx::InsetsF::Scale ( float  scale) const
inline

Definition at line 76 of file insets_f.h.

76 {
77 return InsetsF(scale * top(), scale * left(), scale * bottom(),
78 scale * right());
79 }
const Scalar scale

◆ Set()

void gfx::InsetsF::Set ( float  top,
float  left,
float  bottom,
float  right 
)
inline

Definition at line 44 of file insets_f.h.

44 {
45 top_ = top;
46 left_ = left;
47 bottom_ = bottom;
48 right_ = right;
49 }

◆ top()

constexpr float gfx::InsetsF::top ( ) const
inlineconstexpr

Definition at line 28 of file insets_f.h.

28{ return top_; }

◆ ToString()

std::string gfx::InsetsF::ToString ( ) const

Definition at line 11 of file insets_f.cc.

11 {
12 // Print members in the same order of the constructor parameters.
13 return base::StringPrintf("%f,%f,%f,%f", top(), left(), bottom(), right());
14}
std::string StringPrintf(const std::string &format, Args... args)

◆ width()

constexpr float gfx::InsetsF::width ( ) const
inlineconstexpr

Definition at line 35 of file insets_f.h.

35{ return left_ + right_; }

The documentation for this class was generated from the following files: