Look at the folowing display:
Please, note that staff lines and note stems are rendered using DC->DrawLine() and that musical symbols (clef, time signature and note heads are rendered using DC->DrawText(). The problem is the clipping region that exists. Observe that due to the cliping line the first notehead is not rendered., and the clef and time signature are clipped.
This clipping region apears spontaneously for a certain very limited scaling factors . And it apears only for the text. Note that the lines get perfectly rendered, so it is not a problem with the DC clipping region (although I don't use clipping regions) or repaint rectangles computation. The offending scale range varies from computer to computer and even does not exist. In the shown example the trouble zooming factors are between 185% and 215%. For any other zooming factor the program works perfectly.
I've been trying to determine the problem, suspecting from my code (repaint rectangles, destroying clipping region before using the DC, ...) but I can not find anything wrong and the behaviour does not change. So I did the following test:
I modified notehead renderization code adding DC->DrawRectangle() just after rendering the note head. Here is the code (3 added lines commented out):
Code: Select all
} else {
// else (drawing phase) do the draw
wxPoint pos = GetGlyphPosition();
pDC->SetTextForeground(colorC);
pDC->DrawText(sGlyph, pos.x, pos.y );
//lmMicrons nWidth, nHeight;
//pDC->GetTextExtent(sGlyph, &nWidth, &nHeight);
//pDC->DrawRectangle(pos.x, pos.y, nWidth, nHeight);
wxLogMessage(_T("[lmNote::DrawNoteHead] pos=(%d, %d)"), pos.x, pos.y);
}
So my conclusion is that the DC is not clipped as the rectangles get perfectly rendered. Also I can not see anything in my code to cause the text being clipped.
I am desperate. I do not know how to continue and I have the program release suspended just because this bug!!!
Could you please help me? Is there is a bug in wxDC (windows XP and WIndows 98 version)? Other ideas? The problem happens with 2.6.2 and with 2.6.3
Thank you very much.[/img]