Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #63481: scale symbols, trill lines, arpeggios, and glissandi #2048

Merged
merged 2 commits into from Jun 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions libmscore/arpeggio.cpp
Expand Up @@ -119,6 +119,8 @@ void Arpeggio::layout()
qreal y1 = -_userLen1;
qreal y2 = _height + _userLen2;

if (staff())
setMag(staff()->mag());
switch (arpeggioType()) {
case ArpeggioType::NORMAL: {
symbolLine(SymId::wiggleArpeggiatoUp, SymId::wiggleArpeggiatoUp);
Expand Down
3 changes: 3 additions & 0 deletions libmscore/bsymbol.cpp
Expand Up @@ -13,6 +13,7 @@
#include "score.h"
#include "image.h"
#include "xml.h"
#include "staff.h"

namespace Ms {

Expand Down Expand Up @@ -159,6 +160,8 @@ Element* BSymbol::drop(const DropData& data)

void BSymbol::layout()
{
if (staff())
setMag(staff()->mag());
for (Element* e : _leafs)
e->layout();
adjustReadPos();
Expand Down
2 changes: 1 addition & 1 deletion libmscore/element.cpp
Expand Up @@ -232,7 +232,7 @@ qreal Element::spatium() const

qreal Element::magS() const
{
return mag() * (_score->spatium() /(MScore::DPI * SPATIUM20));
return mag() * (_score->spatium() / (MScore::DPI * SPATIUM20));
}

//---------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions libmscore/glissando.cpp
Expand Up @@ -50,6 +50,8 @@ static const qreal GLISS_PALETTE_HEIGHT = 4.0;

void GlissandoSegment::layout()
{
if (staff())
setMag(staff()->mag());
QRectF r = QRectF(0.0, 0.0, pos2().x(), pos2().y()).normalized();
qreal lw = spatium() * glissando()->lineWidth().val() * .5;
setbbox(r.adjusted(-lw, -lw, lw, lw));
Expand Down
10 changes: 6 additions & 4 deletions libmscore/textline.cpp
Expand Up @@ -180,7 +180,6 @@ void TextLineSegment::setText(Text* t)
_text = new Text(*t);
_text->setFlag(ElementFlag::MOVABLE, false);
_text->setParent(this);
_text->setTrack(track());
}
else {
_text->setTextStyleType(t->textStyleType());
Expand Down Expand Up @@ -223,7 +222,6 @@ void TextLineSegment::layout1()
_endText = new Text(*tl->_endText);
_endText->setFlag(ElementFlag::MOVABLE, false);
_endText->setParent(this);
_endText->setTrack(track());
}
else {
_endText->setTextStyleType(tl->_endText->textStyleType());
Expand All @@ -236,10 +234,14 @@ void TextLineSegment::layout1()
_endText = 0;
}

if (_text)
if (_text) {
_text->setTrack(track());
_text->layout();
if (_endText)
}
if (_endText) {
_endText->setTrack(track());
_endText->layout();
}

QPointF pp1;
QPointF pp2(pos2());
Expand Down
3 changes: 3 additions & 0 deletions libmscore/trill.cpp
Expand Up @@ -20,6 +20,7 @@
#include "score.h"
#include "accidental.h"
#include "segment.h"
#include "staff.h"

namespace Ms {

Expand Down Expand Up @@ -124,6 +125,8 @@ void TrillSegment::layout()
{
if (parent())
rypos() += score()->styleS(StyleIdx::trillY).val() * spatium();
if (staff())
setMag(staff()->mag());
if (spannerSegmentType() == SpannerSegmentType::SINGLE || spannerSegmentType() == SpannerSegmentType::BEGIN) {
Accidental* a = trill()->accidental();
if (a) {
Expand Down
2 changes: 1 addition & 1 deletion vtest/gen
Expand Up @@ -50,7 +50,7 @@ else
beams-11 beams-12 beams-13 beams-14 beams-15 beams-16 beams-17\
user-offset-1 user-offset-2 chord-space-1 chord-space-2 tablature-1 image-1\
lyrics-1 lyrics-2 lyrics-3 lyrics-4 lyrics-5 lyrics-6 voice-1 voice-2 slash-1 slash-2\
system-1 system-2 system-3 system-4"
system-1 system-2 system-3 system-4 small-1"
fi

DPI=130
Expand Down
2 changes: 1 addition & 1 deletion vtest/gen.bat
Expand Up @@ -25,7 +25,7 @@ set SRC=mmrest-1,bravura-mmrest,gonville-mmrest,mmrest-2,mmrest-4,mmrest-5,mmres
beams-11,beams-12,beams-13,beams-14,beams-15,beams-16,beams-17, ^
user-offset-1,user-offset-2,chord-space-1,chord-space-2,tablature-1,image-1, ^
lyrics-1,lyrics-2,lyrics-3,lyrics-4,lyrics-5,lyrics-6,voice-1,voice-2,slash-1,slash-2, ^
system-1,system-2,system-3,system-4
system-1,system-2,system-3,system-4,small-1

set MSCORE=..\win32install\bin\musescore.exe
set DPI=130
Expand Down
Binary file added vtest/small-1-ref.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vtest/small-1.mscz
Binary file not shown.