Skip to content

Commit

Permalink
Merge pull request #4651 from jthistle/282507-imported-framegap-lost-…
Browse files Browse the repository at this point in the history
…on-save

fix #282507: imported frame gap of 0 lost on save
  • Loading branch information
anatoly-os committed Mar 8, 2019
1 parent aaed7ce commit 5749fe8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libmscore/read206.cpp
Expand Up @@ -3360,6 +3360,8 @@ static void readBox(Box* b, XmlReader& e)
b->setBottomMargin(0.0);
b->setTopGap(0.0);
b->setBottomGap(0.0);
b->setPropertyFlags(Pid::TOP_GAP, PropertyFlags::UNSTYLED);
b->setPropertyFlags(Pid::BOTTOM_GAP, PropertyFlags::UNSTYLED);

b->setBoxHeight(Spatium(0)); // override default set in constructor
b->setBoxWidth(Spatium(0));
Expand Down Expand Up @@ -3467,9 +3469,17 @@ static void readStaffContent(Score* score, XmlReader& e)
readBox(b, e);
b->setTick(e.tick());
score->measures()->add(b);
lastReadBox = b;
if (readMeasureLast)

// If it's the first box, and comes before any measures, reset to
// 301 default.
if (!readMeasureLast && !lastReadBox) {
b->setTopGap(b->propertyDefault(Pid::TOP_GAP).toReal());
b->setPropertyFlags(Pid::TOP_GAP, PropertyFlags::STYLED);
}
else if (readMeasureLast)
b->setTopGap(b->topGap() + b->propertyDefault(Pid::TOP_GAP).toReal());

lastReadBox = b;
readMeasureLast = false;
}
else if (tag == "tick")
Expand Down

0 comments on commit 5749fe8

Please sign in to comment.