Image capture: auto-resize selects system break

• Feb 3, 2021 - 17:31

Image capture: auto-resize selects and includes the system break:

Image Capture Issue.png

I don't recall the previous version having this issue.

Attachment Size
In Church (Tchaikovsky) (Excerpt).mscz 14.43 KB

Comments

If i rightclick on the blue selection and use "print mode", it saves the image without line breaks. (maybe i dont get the issue)

In reply to by Marc Sabatella

I can't prove it, but I swear the most recent version(s) didn't include the system break. In any event, what would the purpose be for including the system break in the image, since it won't show when saving as Print Mode, yet leaves a bunch of unwanted blank space in the image at the top?

In reply to by Marc Sabatella

I have two solutions for this, and I see no reason why they could not be combined.

The first solution is to add ElementType::LAYOUT_BREAK to the list of element types that return false for Element::isPrintable(). https://github.com/mattmcclinch/MuseScore/commit/3452fad

The second solution is to ignore invisible elements when calculating Page::tbbox(). For this solution to work on its own, LayoutBreak elements need to know that they are invisible. https://github.com/mattmcclinch/MuseScore/commit/96f6a40

Both Page::tbbox() and Element::isPrintable() were added specifically for the purpose of trimming whitespace from exported PNG images in order to implement the Auto-resize function for the image capture facility. https://github.com/musescore/MuseScore/commit/f430751

In reply to by mattmcclinch

Hmm, I wonder, we also have the View menu option to toggle display of unprintable items, I wonder why these don't agree? I can't remember if that option existed when I added trim code.

Anyhow, there are actually worse problems with the auto resize right now, it seems if you move the box it gets out of sync and future attempts to use the function get the positioned wrong. See #314437: Image capture: "Auto-resize to page" misbehaves. But also, there is #305451: Image capture selection moves out of sight. We should probably look at all of these together and try to really fix this.

Do you still have an unanswered question? Please log in first to post your question.