Fixed maximal font size
--HG-- branch : feature
This commit is contained in:
parent
c5f38207fd
commit
06cfaea3b3
|
@ -138,12 +138,13 @@ bool VTextManager::IsBigEnough(qreal fW, qreal fH, int iFontSize)
|
||||||
TextLine tlOut = tl;
|
TextLine tlOut = tl;
|
||||||
fnt.setPixelSize(iFontSize + tl.m_iFontSize);
|
fnt.setPixelSize(iFontSize + tl.m_iFontSize);
|
||||||
QFontMetrics fm(fnt);
|
QFontMetrics fm(fnt);
|
||||||
|
int iHorSp = fm.width(" ");
|
||||||
tlOut.m_iHeight = fm.height();
|
tlOut.m_iHeight = fm.height();
|
||||||
QStringList qslLines = SplitString(tlOut.m_qsText, fW, fm);
|
QStringList qslLines = SplitString(tlOut.m_qsText, fW, fm);
|
||||||
for (int iL = 0; iL < qslLines.count(); ++iL)
|
for (int iL = 0; iL < qslLines.count(); ++iL)
|
||||||
{
|
{
|
||||||
// check if every line fits within the label width
|
// check if every line fits within the label width
|
||||||
if (fm.width(qslLines[iL]) + 2*GetSpacing() > fW)
|
if (fm.width(qslLines[iL]) + iHorSp > fW)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include "../ifc/xml/vabstractpattern.h"
|
#include "../ifc/xml/vabstractpattern.h"
|
||||||
|
|
||||||
#define MIN_FONT_SIZE 12
|
#define MIN_FONT_SIZE 12
|
||||||
#define MAX_FONT_SIZE 128
|
#define MAX_FONT_SIZE 1024
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The TextLine struct holds the information about one text line
|
* @brief The TextLine struct holds the information about one text line
|
||||||
|
|
Loading…
Reference in New Issue
Block a user