Skip to content
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 #41906: make screenshot mode rectangle appear within current view #1519

Merged
merged 1 commit into from Dec 10, 2014

Conversation

MarcSabatella
Copy link
Contributor

When enabling screenshot mode, center rectangle in current view unless previous rectangle exists and would be within view.

I'm totally comfortable with the logic here. What I don't know is if there is better way of obtaining the rectangle corresponding to the current view. See my line comment.

qreal h = height() / _matrix.m22();
_foto->setRect(QRectF(w * .3, h * .3, w * .4, h * .4));
// try to find existing rect within current view
QRectF view(-xoffset() / _matrix.m11(), -yoffset() / _matrix.m22(), width() / _matrix.m11(), height() / _matrix.m22());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Somehow this seems way more complex than it should be. There is not a simple "currentRect()" function to return the current view in canvas coordinates?

Copy link
Contributor

Choose a reason for hiding this comment

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

toLogical() in ScoreView? Apparently it's how we draw the visible zone in the navigator.

@MarcSabatella
Copy link
Contributor Author

Yep, toLogical() works, now that I know what parameters to pass.

lasconic added a commit that referenced this pull request Dec 10, 2014
fix #41906: make screenshot mode rectangle appear within current view
@lasconic lasconic merged commit 4c40585 into musescore:master Dec 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants