diff --git a/libmscore/line.cpp b/libmscore/line.cpp index e7f935591e..47d1bd75c2 100644 --- a/libmscore/line.cpp +++ b/libmscore/line.cpp @@ -206,6 +206,8 @@ QPointF LineSegment::gripAnchor(int grip) const bool LineSegment::edit(MuseScoreView* sv, int curGrip, int key, Qt::KeyboardModifiers modifiers, const QString&) { + printf("LineSegment::edit\n"); + if (!((modifiers & Qt::ShiftModifier) && ((spannerSegmentType() == SEGMENT_SINGLE) || (spannerSegmentType() == SEGMENT_BEGIN && curGrip == GRIP_LINE_START) @@ -221,23 +223,35 @@ bool LineSegment::edit(MuseScoreView* sv, int curGrip, int key, Qt::KeyboardModi if (l->anchor() == Spanner::ANCHOR_SEGMENT) { Segment* s1 = score()->tick2nearestSegment(spanner()->tick()); Segment* s2 = score()->tick2nearestSegment(spanner()->tick2()); - if (!s1 || !s2) + if (!s1) { + qDebug("LineSegment::edit: no start segment"); return true; + } if (key == Qt::Key_Left) { if (curGrip == GRIP_LINE_START) s1 = prevSeg1(s1, track); - else if (curGrip == GRIP_LINE_END || curGrip == GRIP_LINE_MIDDLE) - s2 = prevSeg1(s2, track); + else if (curGrip == GRIP_LINE_END || curGrip == GRIP_LINE_MIDDLE) { + if (s2) + s2 = prevSeg1(s2, track); + else { + Measure* m = score()->lastMeasure(); + s2 = m->last(); + if (s2->segmentType() != Segment::SegChordRest) + s2 = s2->prev(Segment::SegChordRest); + } + } } else if (key == Qt::Key_Right) { if (curGrip == GRIP_LINE_START) s1 = nextSeg1(s1, track); else if (curGrip == GRIP_LINE_END || curGrip == GRIP_LINE_MIDDLE) { - if ((s2->system()->firstMeasure() == s2->measure()) - && (s2->tick() == s2->measure()->tick())) - bspDirty = true; - s2 = nextSeg1(s2, track); + if (s2) { + if ((s2->system()->firstMeasure() == s2->measure()) + && (s2->tick() == s2->measure()->tick())) + bspDirty = true; + s2 = nextSeg1(s2, track); + } } } if (s1 == 0 || s2 == 0 || s1->tick() >= s2->tick()) @@ -454,7 +468,7 @@ QPointF SLine::linePos(int grip, System** sys) { qreal _spatium = spatium(); qreal x = 0.0; - switch(anchor()) { + switch (anchor()) { case Spanner::ANCHOR_SEGMENT: { if (grip == GRIP_LINE_START) { diff --git a/libmscore/ottava.cpp b/libmscore/ottava.cpp index 2332210007..6ba77213b6 100644 --- a/libmscore/ottava.cpp +++ b/libmscore/ottava.cpp @@ -56,7 +56,6 @@ void OttavaSegment::layout() qreal yo(score()->styleS(ST_ottavaY).val() * spatium()); if (ottava()->placement() == BELOW) yo = -yo + staff()->height(); -// rypos() += yo; rypos() = yo; } adjustReadPos(); diff --git a/mscore/debugger/debugger.cpp b/mscore/debugger/debugger.cpp index b077931632..4bc1bf24e4 100644 --- a/mscore/debugger/debugger.cpp +++ b/mscore/debugger/debugger.cpp @@ -1454,7 +1454,7 @@ void SpannerView::setElement(Element* e) Spanner* spanner = static_cast(e); ShowElementBase::setElement(e); sp.tick->setValue(spanner->tick()); - sp.tickLen->setValue(spanner->tickLen()); + sp.tick2->setValue(spanner->tick2()); sp.anchor->setCurrentIndex(int(spanner->anchor())); sp.segments->clear(); diff --git a/mscore/debugger/spanner.ui b/mscore/debugger/spanner.ui index fcb7a84a0a..8769aad949 100644 --- a/mscore/debugger/spanner.ui +++ b/mscore/debugger/spanner.ui @@ -6,7 +6,7 @@ 0 0 - 436 + 489 214 @@ -17,7 +17,16 @@ 6 - + + 8 + + + 8 + + + 8 + + 8 @@ -70,7 +79,7 @@ - tickLen: + tick2: @@ -116,7 +125,7 @@ - + 999999 diff --git a/mscore/scoreview.cpp b/mscore/scoreview.cpp index 21d628b2a3..4ed88ef761 100644 --- a/mscore/scoreview.cpp +++ b/mscore/scoreview.cpp @@ -1532,21 +1532,22 @@ void ScoreView::paintEvent(QPaintEvent* ev) } if (grips) { - qreal lw = 2.0/vp.matrix().m11(); - QPen pen(MScore::frameMarginColor); - pen.setWidthF(lw); if (grips == 6) { // HACK: this are grips of a slur - vp.setPen(pen); QPolygonF polygon(grips+1); for (int i = 0; i < grips; ++i) polygon[i] = QPointF(grip[i].center()); polygon[grips] = QPointF(grip[0].center()); + QPen pen(MScore::frameMarginColor, 2.0/vp.matrix().m11()); + vp.setPen(pen); vp.drawPolyline(polygon); } - pen.setColor(MScore::defaultColor); + QPen pen(MScore::defaultColor, 0.0); vp.setPen(pen); for (int i = 0; i < grips; ++i) { - vp.setBrush(((i == curGrip) && hasFocus()) ? MScore::selectColor[0] : Qt::NoBrush); + if (i == curGrip && hasFocus()) + vp.setBrush(MScore::selectColor[0]); + else + vp.setBrush(Qt::NoBrush); vp.drawRect(grip[i]); } if (editObject) // if object is moved, it may not be covered by bsp