Calculate font pixel size if the size was set with setPointSize() or setPointSizeF().
This commit is contained in:
parent
e9f42bda30
commit
5fb441c9ba
|
@ -334,7 +334,14 @@ void VTextGraphicsItem::SetPieceName(const QString &name)
|
||||||
*/
|
*/
|
||||||
auto VTextGraphicsItem::GetFontSize() const -> int
|
auto VTextGraphicsItem::GetFontSize() const -> int
|
||||||
{
|
{
|
||||||
return m_tm.GetFont().pixelSize();
|
int size = m_tm.GetFont().pixelSize();
|
||||||
|
if (size == -1)
|
||||||
|
{
|
||||||
|
QFontMetrics fontMetrics(m_tm.GetFont());
|
||||||
|
size = fontMetrics.height();
|
||||||
|
}
|
||||||
|
|
||||||
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user