Skip to content

Commit

Permalink
fix #277542 Calculation of bounding box for chord sysbols too big
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer authored and anatoly-os committed Oct 29, 2018
1 parent af10f0a commit f003fba
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 140 deletions.
14 changes: 4 additions & 10 deletions libmscore/harmony.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,19 +1065,13 @@ void Harmony::layout()

void Harmony::calculateBoundingRect()
{
if (textList.empty()) {
if (textList.empty())
TextBase::layout1();
setbboxtight(bbox());
}
else {
// textStyle().layout(this);
QRectF bb, tbb;
foreach(const TextSegment* ts, textList) {
bb |= ts->boundingRect().translated(ts->x, ts->y);
tbb |= ts->tightBoundingRect().translated(ts->x, ts->y);
}
QRectF bb;
for (const TextSegment* ts : textList)
bb |= ts->tightBoundingRect().translated(ts->x, ts->y);
setbbox(bb);
setbboxtight(tbb);
}
}

Expand Down
4 changes: 0 additions & 4 deletions libmscore/harmony.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ class Harmony final : public TextBase {
void textChanged();
virtual void layout() override;

const QRectF& bboxtight() const { return _tbbox; }
QRectF& bboxtight() { return _tbbox; }
void setbboxtight(const QRectF& r) const { _tbbox = r; }

virtual bool isEditable() const override { return true; }
virtual void startEdit(EditData&) override;
virtual bool edit(EditData&) override;
Expand Down
4 changes: 0 additions & 4 deletions mscore/debugger/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1491,10 +1491,6 @@ void HarmonyView::setElement(Element* e)
//TODO tb.textStyle->setCurrentIndex(ts.textStyleType());
tb.layoutToParentWidth->setChecked(harmony->layoutToParentWidth());

hb.tbboxx->setValue(harmony->bboxtight().x());
hb.tbboxy->setValue(harmony->bboxtight().y());
hb.tbboxw->setValue(harmony->bboxtight().width());
hb.tbboxh->setValue(harmony->bboxtight().height());
hb.leftParen->setChecked(harmony->leftParen());
hb.rightParen->setChecked(harmony->rightParen());
hb.rootTpc->setValue(harmony->rootTpc());
Expand Down
122 changes: 0 additions & 122 deletions mscore/debugger/harmony.ui
Original file line number Diff line number Diff line change
Expand Up @@ -23,128 +23,6 @@
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string notr="true">Tight BBox</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="indent">
<number>5</number>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="tbboxx">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-100000.000000000000000</double>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="tbboxy">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-100000.000000000000000</double>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string notr="true">w/h</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="margin">
<number>0</number>
</property>
<property name="indent">
<number>5</number>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="tbboxw">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-100000.000000000000000</double>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="tbboxh">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-100000.000000000000000</double>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
Expand Down

0 comments on commit f003fba

Please sign in to comment.