fix #49956: Center and right alignment in text frames does not work as expected

This commit is contained in:
lasconic 2015-03-07 22:28:25 +01:00
parent 3e750aee62
commit 091cf77569
2 changed files with 15 additions and 0 deletions

View file

@ -35,6 +35,7 @@ TBox::TBox(Score* score)
{
setBoxHeight(Spatium(1));
_text = new Text(score);
_text->setLayoutToParentWidth(true);
_text->setParent(this);
_text->setTextStyleType(TextStyleType::FRAME);
}
@ -99,5 +100,18 @@ void TBox::scanElements(void* data, void (*func)(void*, Element*), bool all)
_text->scanElements(data, func, all);
Box::scanElements(data, func, all);
}
//---------------------------------------------------------
// remove
//---------------------------------------------------------
void TBox::remove(Element* el)
{
if (el == _text) {
_text->clear();
}
else
MeasureBase::remove(el);
}
}

View file

@ -36,6 +36,7 @@ class TBox : public VBox {
virtual void layout();
virtual void scanElements(void* data, void (*func)(void*, Element*), bool all=true);
virtual void remove(Element* el);
Text* text() { return _text; }
};