Skip to content

Commit f265671

Browse files
committed
Fix #317319: Remove unneeded skyline extension for time- and key signatures
Backport of musescore#7498 resp. duplicate of musescore#7464, Expected vtest failures.
1 parent 8c5e93c commit f265671

File tree

4 files changed

+0
-42
lines changed

4 files changed

+0
-42
lines changed

libmscore/keysig.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -280,26 +280,6 @@ void KeySig::layout()
280280
}
281281
}
282282

283-
//---------------------------------------------------------
284-
// shape
285-
//---------------------------------------------------------
286-
287-
Shape KeySig::shape() const
288-
{
289-
QRectF box(bbox());
290-
const Staff* st = staff();
291-
if (st && addToSkyline()) {
292-
// Extend key signature shape up and down to
293-
// the first ledger line height to ensure that
294-
// no notes will be too close to the keysig.
295-
const qreal sp = spatium();
296-
const qreal y = pos().y();
297-
box.setTop(std::min(-sp - y, box.top()));
298-
box.setBottom(std::max(st->height() - y + sp, box.bottom()));
299-
}
300-
return Shape(box);
301-
}
302-
303283
//---------------------------------------------------------
304284
// set
305285
//---------------------------------------------------------

libmscore/keysig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class KeySig final : public Element {
4444
bool acceptDrop(EditData&) const override;
4545
Element* drop(EditData&) override;
4646
void layout() override;
47-
Shape shape() const override;
4847
qreal mag() const override;
4948

5049
//@ sets the key of the key signature

libmscore/timesig.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -378,26 +378,6 @@ void TimeSig::layout()
378378
}
379379
}
380380

381-
//---------------------------------------------------------
382-
// shape
383-
//---------------------------------------------------------
384-
385-
Shape TimeSig::shape() const
386-
{
387-
QRectF box(bbox());
388-
const Staff* st = staff();
389-
if (st && addToSkyline()) {
390-
// Extend time signature shape up and down to
391-
// the first ledger line height to ensure that
392-
// no notes will be too close to the timesig.
393-
const qreal sp = spatium();
394-
const qreal y = pos().y();
395-
box.setTop(std::min(-sp - y, box.top()));
396-
box.setBottom(std::max(st->height() - y + sp, box.bottom()));
397-
}
398-
return Shape(box);
399-
}
400-
401381
//---------------------------------------------------------
402382
// draw
403383
//---------------------------------------------------------

libmscore/timesig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ class TimeSig final : public Element {
7979
void write(XmlWriter& xml) const override;
8080
void read(XmlReader&) override;
8181
void layout() override;
82-
Shape shape() const override;
8382

8483
Fraction sig() const { return _sig; }
8584
void setSig(const Fraction& f, TimeSigType st = TimeSigType::NORMAL);

0 commit comments

Comments
 (0)