-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 #16396: Tie invisibility crossing system breaks #21347
Conversation
I found that there are some similar problems:
There may be even more cases (I haven't tested bends for example). And perhaps there are even more properties to which this applies, for example the "auto-place" property. |
tie color and glissando visibility seem easy to fix (1-liner each), slur color not so much (haven't found a way yet) Actually that's a 1-liner too... tie color: diff --git a/libmscore/tie.cpp b/libmscore/tie.cpp
index 8d6f37c4c2..66f7f3bac3 100644
--- a/libmscore/tie.cpp
+++ b/libmscore/tie.cpp
@@ -1010,6 +1010,7 @@ TieSegment* Tie::layoutBack(System* system)
TieSegment* segment = segmentAt(1);
segment->setSystem(system);
segment->setVisible(visible());
+ segment->setColor(color());
qreal x = system->firstNoteRestSegmentX(true); glissando visibility: diff --git a/libmscore/glissando.cpp b/libmscore/glissando.cpp
index 4be6756624..6f36e1f9c1 100644
--- a/libmscore/glissando.cpp
+++ b/libmscore/glissando.cpp
@@ -82,7 +82,7 @@ void GlissandoSegment::draw(QPainter* painter) const
painter->save();
qreal _spatium = spatium();
- QPen pen(curColor(visible(), glissando()->lineColor()));
+ QPen pen(curColor(glissando()->visible(), glissando()->lineColor()));
pen.setWidthF(glissando()->lineWidth());
pen.setCapStyle(Qt::FlatCap);
painter->setPen(pen); slur color diff --git a/libmscore/slur.cpp b/libmscore/slur.cpp
index 28302c1b01..4aa7dba0c1 100644
--- a/libmscore/slur.cpp
+++ b/libmscore/slur.cpp
@@ -30,7 +30,7 @@ namespace Ms {
void SlurSegment::draw(QPainter* painter) const
{
- QPen pen(curColor());
+ QPen pen(curColor(slur()->visible(), slur()->color()));
qreal mag = staff() ? staff()->mag(slur()->tick()) : 1.0;
//Replace generic Qt dash patterns with improved equivalents to show true dots (keep in sync with tie.cpp) That's for 3.x though |
05492fc
to
4e89c16
Compare
That's even better, much more consistent |
4e89c16
to
ec7a682
Compare
But @cbjeukendrup is right: AutoPlace is affected too, albeit different: it disconects regardless whether set before apply a system braek or after, so seems a different issue altogether |
… breaks Backport of musescore#21347
Thanks @Jojo-Schmitz for finding the places for slurs and glissandos! I agree that autoplace is a different issue, since this PR currently only changes the visual rendering of the elements and not any actual properties themselves. |
Same issue and fix seems to apply to GuitarBend(Segment and GuitarBendHoldSegment), as far as I can tell. |
Guitar bends seem fine in master (both visibility and color) |
… breaks Backport of musescore#21347
fa1f8d3
to
525a11a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a more elegant solution IMO. We have a method called propertyDelegate
which is used by SpannerSegments to "delegate" a given property to their Spanner. If you look at SpannerSegment::propertyDelegate
you'll see that visible
and color
are already delegated. Problem is that calling the visible()
method returns the internal value directly and bypasses the property routing. I think this may be solved by just calling item->getProperty(Pid::VISIBLE)
rather then item->visible()
.
I guess it'd need to be But what about the color? |
My understanding would be |
Yep! |
|
… breaks Backport of musescore#21347
ec7a682
to
b3e3645
Compare
b3e3645
to
96d4866
Compare
… breaks Backport of musescore#21347
… breaks Backport of musescore#21347
… breaks Backport of musescore#21347
… breaks Backport of musescore#21347
Resolves: #16396