Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
skia::textlayout::PlaceholderStyle Struct Reference

#include <TextStyle.h>

Public Member Functions

 PlaceholderStyle ()=default
 
 PlaceholderStyle (SkScalar width, SkScalar height, PlaceholderAlignment alignment, TextBaseline baseline, SkScalar offset)
 
bool equals (const PlaceholderStyle &) const
 

Public Attributes

SkScalar fWidth = 0
 
SkScalar fHeight = 0
 
PlaceholderAlignment fAlignment = PlaceholderAlignment::kBaseline
 
TextBaseline fBaseline = TextBaseline::kAlphabetic
 
SkScalar fBaselineOffset = 0
 

Detailed Description

Definition at line 124 of file TextStyle.h.

Constructor & Destructor Documentation

◆ PlaceholderStyle() [1/2]

skia::textlayout::PlaceholderStyle::PlaceholderStyle ( )
default

◆ PlaceholderStyle() [2/2]

skia::textlayout::PlaceholderStyle::PlaceholderStyle ( SkScalar  width,
SkScalar  height,
PlaceholderAlignment  alignment,
TextBaseline  baseline,
SkScalar  offset 
)
inline

Definition at line 126 of file TextStyle.h.

128 : fWidth(width)
129 , fHeight(height)
130 , fAlignment(alignment)
131 , fBaseline(baseline)
int32_t height
int32_t width
SeparatedVector2 offset
PlaceholderAlignment fAlignment
Definition: TextStyle.h:138

Member Function Documentation

◆ equals()

bool skia::textlayout::PlaceholderStyle::equals ( const PlaceholderStyle other) const

Definition at line 197 of file TextStyle.cpp.

197 {
198 return nearlyEqual(fWidth, other.fWidth) &&
199 nearlyEqual(fHeight, other.fHeight) &&
200 fAlignment == other.fAlignment &&
201 fBaseline == other.fBaseline &&
203 nearlyEqual(fBaselineOffset, other.fBaselineOffset));
204}
@ kBaseline
Match the baseline of the placeholder with the baseline.
static bool nearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
Definition: TextStyle.h:31

Member Data Documentation

◆ fAlignment

PlaceholderAlignment skia::textlayout::PlaceholderStyle::fAlignment = PlaceholderAlignment::kBaseline

Definition at line 138 of file TextStyle.h.

◆ fBaseline

TextBaseline skia::textlayout::PlaceholderStyle::fBaseline = TextBaseline::kAlphabetic

Definition at line 139 of file TextStyle.h.

◆ fBaselineOffset

SkScalar skia::textlayout::PlaceholderStyle::fBaselineOffset = 0

Definition at line 148 of file TextStyle.h.

◆ fHeight

SkScalar skia::textlayout::PlaceholderStyle::fHeight = 0

Definition at line 137 of file TextStyle.h.

◆ fWidth

SkScalar skia::textlayout::PlaceholderStyle::fWidth = 0

Definition at line 136 of file TextStyle.h.


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