while dragging a full measure rest, it gets displayed to far to the left

• Jan 3, 2015 - 18:21
Reported version
S4 - Minor

while dragging a full measure rest with the mouse, it gets displayed to far to the left, at the place where a whole rest would show.

self built f78aca0, Windows 7 (Enterprise, 64bit)


Confirmed. It's only *while* dragging, and edit mode & Inspector both work normally. The algorithm for drawing the measure rest is kind of odd - it has to happen somewhere different from other notes because it displays at the "wrong" position for its segment, so I guess that's the source of the problem.

I think it happens at rest.cpp:354 (in Rest::layout()):
{syntaxhighlighter }
rxpos() = 0.0;
The x position is set to zero while dragging, which only affects full measure rests since the x position of other rests is already zero. If this is the case, is this line necessary?

Good question. According to the git "blame", that line was added in the following commit:


which was done to fix the following bug:

#18187: rests not placed correctly

But commenting out that line doesn't seem to break that fix again. Maybe that line is no longer needed, but it would be good to understand. I suspect maybe changes elsewhere to the layout of full measures rests has rendered this unnecessary, but I can't say for sure. If nothing else, it should be safer to set rxpos() to 0 *if* the rest is not a full measure rest.

FWIW, though, layout() isn't called just during dragging; it's called any time we need to calculation position. So changing things here won't just affect drag - it will potentially affect all layout. Meaning it's important to test thoroughly.

Status (old) fixed active

I had to revert this. It somehow breaks some tests beyond repair but I believe it just reveal another bug. Let's take a look later when the layout code is more stable.