fix #181701 TextTools spinbox minimum set to 1.

This prevents a bug in 3.0 whereby musescore would be killed if set text size to 0.

I also put in a Q_ASSERT into CharFormat::setFontSize() to ensure FontSize is positive real.
This commit is contained in:
Eric Fontaine 2017-03-16 01:40:22 -04:00
parent bd894bd8da
commit bf00271a65
2 changed files with 2 additions and 1 deletions

View file

@ -59,7 +59,7 @@ class CharFormat {
void setUnderline(bool val) { _underline = val; }
void setPreedit(bool val) { _preedit = val; }
void setValign(VerticalAlignment val) { _valign = val; }
void setFontSize(qreal val) { _fontSize = val; }
void setFontSize(qreal val) { Q_ASSERT(val > 0.0); _fontSize = val; }
void setFontFamily(const QString& val) { _fontFamily = val; }
void setFormat(FormatId, QVariant);

View file

@ -93,6 +93,7 @@ TextTools::TextTools(QWidget* parent)
typefaceSize = new QDoubleSpinBox(this);
typefaceSize->setFocusPolicy(Qt::ClickFocus);
typefaceSize->setMinimum(1);
tb->addWidget(typefaceSize);
setWidget(tb);