Skip to content

Commit d95ee3b

Browse files
authored
Merge pull request #30756 from RMRattray/continuous-panel-not-cover-playback
Account for continuous panel when playing back in continuous view
2 parents 302a506 + 976dd29 commit d95ee3b

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

src/notation/view/abstractnotationpaintview.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,14 @@ bool AbstractNotationPaintView::adjustCanvasPosition(const RectF& logicRect, boo
927927
TRACEFUNC;
928928

929929
RectF viewRect = viewport();
930+
PointF pos = viewRect.topLeft();
931+
932+
// Account for continuous panel if panning in continuous view
933+
qreal continuousPanelWidth = 0;
934+
if (notation()->viewMode() == engraving::LayoutMode::LINE) {
935+
continuousPanelWidth = m_continuousPanel->width();
936+
}
937+
viewRect.adjust(continuousPanelWidth, 0, 0, 0);
930938

931939
double viewArea = viewRect.width() * viewRect.height();
932940
double logicRectArea = logicRect.width() * logicRect.height();
@@ -948,17 +956,16 @@ bool AbstractNotationPaintView::adjustCanvasPosition(const RectF& logicRect, boo
948956
_scale = 1;
949957
}
950958

951-
PointF pos = viewRect.topLeft();
952959
PointF oldPos = pos;
953960

954961
RectF showRect = logicRect;
955962

956963
if (showRect.left() < viewRect.left()) {
957-
pos.setX(showRect.left() - border);
964+
pos.setX(showRect.left() - border - continuousPanelWidth);
958965
} else if (showRect.left() > viewRect.right()) {
959966
pos.setX(showRect.right() - width() / _scale + border);
960967
} else if (viewRect.width() >= showRect.width() && showRect.right() > viewRect.right()) {
961-
pos.setX(showRect.left() - border);
968+
pos.setX(showRect.left() - border - continuousPanelWidth);
962969
}
963970

964971
if (adjustVertically) {

src/notation/view/continuouspanel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ void ContinuousPanel::setNotation(INotationPtr notation)
109109
m_notation = notation;
110110
}
111111

112+
qreal ContinuousPanel::width() const
113+
{
114+
return m_width;
115+
}
116+
112117
void ContinuousPanel::paint(Painter& painter, const NotationViewContext& ctx, const engraving::rendering::PaintOptions& opt)
113118
{
114119
TRACEFUNC;

src/notation/view/continuouspanel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class ContinuousPanel : public muse::Injectable
6767
std::function<muse::PointF(const muse::PointF&)> fromLogical;
6868
};
6969

70+
qreal width() const;
7071
void paint(muse::draw::Painter& painter, const NotationViewContext& ctx, const engraving::rendering::PaintOptions& opt);
7172

7273
private:

0 commit comments

Comments
 (0)