-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Guitar Tab fret numbers have a visible white box behind them #11570
Comments
@Tantacrul wow! almost invisible issue, great catch) |
🥇 for me! I guess we'll also need to be careful that by fixing the colour problem, they still appear white when exported as PDF :) |
The real solution would be not to draw a background at all, but make a gap in the staff lines. That way, it would also work correctly when exporting transparent PNGs or SVGs. I believe the reason that it is not done yet that way, is that it's difficult :) |
@cbjeukendrup - it does seem to have been done for MuseScore 3 though? |
Better than what MS4 does, at least :) I do agree with your suggestion for what we should actually do, of course :) But at the least, we should match MS3. |
Any updates on this issue ? I really prefer the all-dark feel because I usually use it at night. But using tablature as linked staffs is unreadable to me unless I use non-inverted scores. |
@bkunda / @oktophonie / @mike-spa - it'd be lovely to fix this. It's such a dumb issue that surely has the simplest fix known to man.
|
A while ago, I had thought of an implementation of the "proper solution". However, I never talked about it because it would bring some significant complications, with potential performance implications. But to elaborate: it is possible (with QPainter) to clear pixels instead of drawing on them, using the SourceOut composition mode. But this will completely clear the pixels that you touch with that painter: even the pixels of the score page background below the actual score. So it will basically create a gap in the whole UI. The difficulties of this solution are:
|
I wonder if we shouldn't just try to implement a system where barlines and stafflines can have gaps in them to accommodate other elements clashing with them? In other words, that the vectors 'know' how to redraw themselves? |
The ability to mask vectors is something we would really need, for several purposes. I'm not sure drawing background rectangles is a general solution: it can work for the examples you mentioned (possibly adapted to the different background colors in UI and in print), but as soon as you get into situations like this So I'd really love to work out a good solution. Which would look ideally like Martin said: it's the tie vector that should know how to interrupt itself where needed, rather then the key and time sigs knowing how to cover what's behind them. @cbjeukendrup I've also been thinking about this for a while. Are you sure that this can't be done by applying a clipRegion to the drawing path of the tie (or tab line, or bar line...)? When I looked into it a while ago, this kind of solution looked quite close to what we'd need, unless I'm misunderstanding it. Or would it cause the same problem you mentioned with the background also being erased? |
To be honest I haven't looked a lot into using clipRegion, but it looks like that would certainly work for ties. However, it does require that the cut-out rectangles are known at the moment that the element that needs to be cut is drawn (i.e. the tie), rather than at the moment that the element that's drawn on top of it is drawn (i.e. the time signature). Basically, with clip rect, you are leaving some space open in advance, instead of drawing on it and then clearing it later whenever that turns out to be necessary. That's doable, also for the fret numbers, but then the staff lines will just need to be informed about the positions of any regions that need to be cleared. Another issue is that this approach will only work for shapes that can be described using a QRegion. That means, only relatively simple shapes. Clearing the shape of an element, like what's necessary for those noteheads with note names inside them, would not be possible using that approach. The erase method does allow to erase any shape that can be drawn. On the other hand, a possible advantage is that (if the necessary data is calculated at layout time) the clip rect approach does not depend on the order in which things are drawn; the erase method does. I would need to investigate whether the clip rect approach would work with SVG out of the box; I fear it doesn't, but that seems at least easier to overcome than with the erase method. The approach that Martin seems to suggest is of course also still an option: just do the calculations ourselves and split the staff lines into multiple pieces with gaps between them, instead of relying on advanced painter features. That will work with SVG for free. But it is less general, so would need to be implemented for each case individually. And the possibilities will be quite limited; we can only split the line into pieces and each piece will have a rectangular end. |
Describe the bug
These white boxes need to be set to match the 'Paper colour', which is set in preferences.
Looks really bad if you change the score background colour to anything other than white (by default we don't use white).
Here's how they look when the score is inverted:
The text was updated successfully, but these errors were encountered: