Skip to content

Commit

Permalink
additional fixes for #74881 and #74946
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Aug 28, 2015
1 parent 1b5956e commit a10486f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
6 changes: 4 additions & 2 deletions libmscore/paste.cpp
Expand Up @@ -404,8 +404,10 @@ bool Score::pasteStaff(XmlReader& e, Segment* dst, int dstStaff)
s->connectTies();

if (pasted) { //select only if we pasted something
Segment* s1 = tick2segment(dstTick);
Segment* s2 = tick2segment(dstTick + tickLen);
if (styleB(StyleIdx::createMultiMeasureRests))
doLayout();
Segment* s1 = tick2segmentMM(dstTick);
Segment* s2 = tick2segmentMM(dstTick + tickLen);
int endStaff = dstStaff + staves;
if (endStaff > nstaves())
endStaff = nstaves();
Expand Down
21 changes: 16 additions & 5 deletions mscore/scoreview.cpp
Expand Up @@ -1938,12 +1938,12 @@ void ScoreView::paint(const QRect& r, QPainter& p)
// this can happen in mmrests
// first chordrest segment of mmrest instead
const Measure* mmr = ss->measure()->mmRest1();
if (mmr)
if (mmr && mmr->system())
ss = mmr->first(Segment::Type::ChordRest);
else
return; // not an mmrest?
return; // still no system?
if (!ss)
return; // mmrest has no chordrest segment?
return; // no chordrest segment?
}

p.setBrush(Qt::NoBrush);
Expand Down Expand Up @@ -1984,11 +1984,22 @@ void ScoreView::paint(const QRect& r, QPainter& p)
System* system1 = system2;
double x1;

for (Segment* s = ss; s && (s != es);) {
for (Segment* s = ss; s && (s != es); ) {
Segment* ns = s->next1MM();
system1 = system2;
system2 = s->measure()->system();
pt = s->pagePos();
if (!system2) {
// as before, use mmrest if necessary
const Measure* mmr = s->measure()->mmRest1();
if (mmr)
system2 = mmr->system();
if (!system2)
break;
// extend rectangle to end of mmrest
pt = mmr->last()->pagePos();
}
else
pt = s->pagePos();
x1 = x2;
x2 = pt.x() + _spatium * 2;

Expand Down

0 comments on commit a10486f

Please sign in to comment.