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;
|
||||
fnt.setPixelSize(iFontSize + tl.m_iFontSize);
|
||||
QFontMetrics fm(fnt);
|
||||
int iHorSp = fm.width(" ");
|
||||
tlOut.m_iHeight = fm.height();
|
||||
QStringList qslLines = SplitString(tlOut.m_qsText, fW, fm);
|
||||
for (int iL = 0; iL < qslLines.count(); ++iL)
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "../ifc/xml/vabstractpattern.h"
|
||||
|
||||
#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
|
||||
|
|
Loading…
Reference in New Issue
Block a user