new feature: use Text::getLineCount to get the number of rows
This commit is contained in:
parent
15e039f278
commit
ead3e52cef
|
|
@ -99,6 +99,13 @@ UINT32 e2d::Text::getColor() const
|
||||||
return m_Font.color;
|
return m_Font.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int e2d::Text::getLineCount() const
|
||||||
|
{
|
||||||
|
DWRITE_TEXT_METRICS metrics;
|
||||||
|
m_pDWriteTextLayout->GetMetrics(&metrics);
|
||||||
|
return static_cast<int>(metrics.lineCount);
|
||||||
|
}
|
||||||
|
|
||||||
bool e2d::Text::isItalic() const
|
bool e2d::Text::isItalic() const
|
||||||
{
|
{
|
||||||
return m_Font.italic;
|
return m_Font.italic;
|
||||||
|
|
|
||||||
|
|
@ -577,6 +577,9 @@ public:
|
||||||
// 获取文字颜色
|
// 获取文字颜色
|
||||||
UINT32 getColor() const;
|
UINT32 getColor() const;
|
||||||
|
|
||||||
|
// 获取文本显示行数
|
||||||
|
int getLineCount() const;
|
||||||
|
|
||||||
// 是否是斜体
|
// 是否是斜体
|
||||||
bool isItalic() const;
|
bool isItalic() const;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue