Skip to content

Commit

Permalink
Fix code style, compiler warnings and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jojo-Schmitz committed Dec 9, 2021
1 parent 552263e commit b7b0fac
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 25 deletions.
3 changes: 1 addition & 2 deletions src/engraving/layout/layoutsystem.cpp
Expand Up @@ -188,7 +188,7 @@ System* LayoutSystem::collectSystem(const LayoutOptions& options, LayoutContext&
ctx.curMeasure->setParent(oldSystem);
}
// If the last appended measure caused a re-layout of the previous measures, now that we are
// removing it we need to re-layout the previous measures again.
// removing it we need to re-layout the previous measures again.
if (changeMinSysTicks) {
minTicks = prevMinTicks; // If the last measure caused it to change, now we need to restore it!
for (MeasureBase* mb : system->measures()) {
Expand Down Expand Up @@ -421,7 +421,6 @@ System* LayoutSystem::collectSystem(const LayoutOptions& options, LayoutContext&
}
mb->setPos(pos);
Measure* m = toMeasure(mb);
qreal stretch = m->basicStretch();
qreal weight = m->stretchWeight(); // Updated stretching formula
ww += rest * weight;
m->stretchMeasure(ww);
Expand Down
4 changes: 0 additions & 4 deletions src/engraving/libmscore/measure.cpp
Expand Up @@ -3152,17 +3152,13 @@ void Measure::stretchMeasure(qreal targetWidth)
{
bbox().setWidth(targetWidth);

Fraction minTick = computeTicks();

//---------------------------------------------------
// compute stretch
//---------------------------------------------------

std::multimap<qreal, Segment*> springs;

//Fraction minTicks = computeTicks();
Fraction minTicks = minSysTicks(); // The stretching must be done according to the shortest note *of the system*!
qreal minNoteSpace = (score()->noteHeadWidth() + score()->styleMM(Sid::minNoteDistance));

Segment* seg = first();
while (seg && (!seg->enabled() || seg->allElementsInvisible())) {
Expand Down
4 changes: 2 additions & 2 deletions src/engraving/utests/beam_data/Beam-A.mscx
Expand Up @@ -712,8 +712,8 @@
</Note>
</Chord>
<Beam>
<l1>38</l1>
<l2>40</l2>
<l1>32</l1>
<l2>38</l2>
</Beam>
<Chord>
<BeamMode>begin</BeamMode>
Expand Down
8 changes: 4 additions & 4 deletions src/engraving/utests/beam_data/Beam-B.mscx
Expand Up @@ -297,8 +297,8 @@
</Chord>
<Beam>
<StemDirection>up</StemDirection>
<l1>-6</l1>
<l2>-8</l2>
<l1>0</l1>
<l2>-6</l2>
</Beam>
<Chord>
<BeamMode>begin</BeamMode>
Expand Down Expand Up @@ -1123,8 +1123,8 @@
</Chord>
<Beam>
<StemDirection>down</StemDirection>
<l1>38</l1>
<l2>40</l2>
<l1>32</l1>
<l2>38</l2>
</Beam>
<Chord>
<durationType>eighth</durationType>
Expand Down
4 changes: 2 additions & 2 deletions src/engraving/utests/beam_data/Beam-C.mscx
Expand Up @@ -255,8 +255,8 @@
</Note>
</Chord>
<Beam>
<l1>-6</l1>
<l2>-8</l2>
<l1>0</l1>
<l2>-6</l2>
</Beam>
<Chord>
<BeamMode>begin</BeamMode>
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/utests/beam_data/Beam-D.mscx
Expand Up @@ -814,7 +814,7 @@
<voice>
<Beam>
<StemDirection>down</StemDirection>
<l1>44</l1>
<l1>42</l1>
<l2>48</l2>
</Beam>
<Chord>
Expand Down
6 changes: 3 additions & 3 deletions src/engraving/utests/beam_data/Beam-E.mscx
Expand Up @@ -990,7 +990,7 @@
<voice>
<Beam>
<StemDirection>down</StemDirection>
<l1>52</l1>
<l1>46</l1>
<l2>48</l2>
</Beam>
<Chord>
Expand All @@ -1010,7 +1010,7 @@
<Beam>
<StemDirection>down</StemDirection>
<l1>52</l1>
<l2>48</l2>
<l2>46</l2>
</Beam>
<Chord>
<BeamMode>begin</BeamMode>
Expand All @@ -1030,7 +1030,7 @@
<Beam>
<StemDirection>down</StemDirection>
<l1>52</l1>
<l2>48</l2>
<l2>46</l2>
</Beam>
<Chord>
<durationType>eighth</durationType>
Expand Down
6 changes: 3 additions & 3 deletions src/engraving/utests/beam_data/Beam-F.mscx
Expand Up @@ -992,7 +992,7 @@
<Beam>
<StemDirection>down</StemDirection>
<l1>48</l1>
<l2>44</l2>
<l2>42</l2>
</Beam>
<Chord>
<durationType>eighth</durationType>
Expand All @@ -1011,7 +1011,7 @@
<Beam>
<StemDirection>down</StemDirection>
<l1>48</l1>
<l2>44</l2>
<l2>42</l2>
</Beam>
<Chord>
<BeamMode>begin</BeamMode>
Expand All @@ -1031,7 +1031,7 @@
<Beam>
<StemDirection>down</StemDirection>
<l1>48</l1>
<l2>44</l2>
<l2>42</l2>
</Beam>
<Chord>
<durationType>eighth</durationType>
Expand Down
6 changes: 3 additions & 3 deletions src/engraving/utests/beam_data/Beam-G.mscx
Expand Up @@ -902,7 +902,7 @@
<Beam>
<StemDirection>down</StemDirection>
<l1>44</l1>
<l2>40</l2>
<l2>38</l2>
</Beam>
<Chord>
<BeamMode>begin</BeamMode>
Expand All @@ -922,7 +922,7 @@
<Beam>
<StemDirection>down</StemDirection>
<l1>44</l1>
<l2>40</l2>
<l2>38</l2>
</Beam>
<Chord>
<durationType>eighth</durationType>
Expand All @@ -941,7 +941,7 @@
<Beam>
<StemDirection>down</StemDirection>
<l1>44</l1>
<l2>40</l2>
<l2>38</l2>
</Beam>
<Chord>
<BeamMode>begin</BeamMode>
Expand Down
Expand Up @@ -287,7 +287,7 @@
<Measure>
<voice>
<Beam>
<l1>24</l1>
<l1>30</l1>
<l2>32</l2>
</Beam>
<Chord>
Expand Down

0 comments on commit b7b0fac

Please sign in to comment.