From 091cf77569256d41a16c831344aa8923cd483aa2 Mon Sep 17 00:00:00 2001 From: lasconic Date: Sat, 7 Mar 2015 22:28:25 +0100 Subject: [PATCH] fix #49956: Center and right alignment in text frames does not work as expected --- libmscore/textframe.cpp | 14 ++++++++++++++ libmscore/textframe.h | 1 + 2 files changed, 15 insertions(+) diff --git a/libmscore/textframe.cpp b/libmscore/textframe.cpp index c9f170dfd4..61b5c68768 100644 --- a/libmscore/textframe.cpp +++ b/libmscore/textframe.cpp @@ -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); + } } diff --git a/libmscore/textframe.h b/libmscore/textframe.h index 8d001376d1..0a60e4234c 100644 --- a/libmscore/textframe.h +++ b/libmscore/textframe.h @@ -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; } };