From d3f31a1fbfac8b11379965a155e6b964b12a71b8 Mon Sep 17 00:00:00 2001 From: Cameron White Date: Mon, 1 Sep 2014 00:23:30 -0400 Subject: [PATCH] Fix #87 and #34 - fix issues with the caret redrawing when changing systems. --- source/painters/caretpainter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/painters/caretpainter.cpp b/source/painters/caretpainter.cpp index 0f6173101..9b818fd74 100644 --- a/source/painters/caretpainter.cpp +++ b/source/painters/caretpainter.cpp @@ -171,11 +171,14 @@ void CaretPainter::onLocationChanged() system.getStaves()[i], i).getStaffHeight(); } - update(boundingRect()); + const QRectF oldRect = sceneBoundingRect(); setPos(0, mySystemRects.at(location.getSystemIndex()).top() + offset + myLayout->getSystemSymbolSpacing() + myLayout->getStaffHeight() - myLayout->getTabStaffBelowSpacing() - myLayout->STAFF_BORDER_SPACING - myLayout->getTabStaffHeight()); + update(boundingRect()); + // Ensure that a redraw always occurs at the old location. + scene()->update(oldRect); setToolTip(QString::fromStdString( boost::lexical_cast(location)));