Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <QQuickItem>
#include <QTimer>
#include <QtMath>

#include "defer.h"
#include "log.h"

Expand Down Expand Up @@ -337,6 +336,14 @@ PointF NotationViewInputController::findZoomFocusPoint() const
// No selection: zoom at the center of the view
resultX = m_view->width() / 2;
resultY = m_view->height() / 2;
} else if (selection->state() == mu::engraving::SelState::LIST) {
RectF rectResult;
for (const mu::engraving::EngravingItem* element : selection->elements()) {
rectResult = rectResult.united(element->canvasBoundingRect());
}
PointF result = m_view->fromLogical(rectResult.center());
resultX = result.x();
resultY = result.y();
} else {
// Selection: zoom at the center of the selection
PointF result = m_view->fromLogical(selection->canvasBoundingRect().center());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think NotationSelection::canvasBoundingRect would actually be the most coherent place for your newly added LIST logic. After a quick search it looks like findZoomFocusPoint is the only place we use this method (you may want to double check that), so I think we're safe to do so.

Expand Down
Loading