Draw everything after coordinate recalc

This commit is contained in:
Matthias Neeracher 2007-04-16 04:47:27 +00:00
parent a5f43d16d1
commit 9869a2deeb

View File

@ -492,17 +492,17 @@ VLMusicElement sSemi2Accidental[12][12] = {
- (void)drawRect:(NSRect)rect - (void)drawRect:(NSRect)rect
{ {
if (fNeedsRecalc || [self inLiveResize]) if (fNeedsRecalc || [self inLiveResize]) {
[self recalculateDimensions]; [self recalculateDimensions];
rect = [self bounds];
}
size_t stanzas = [self song]->CountStanzas(); size_t stanzas = [self song]->CountStanzas();
const float kLineW = fClefKeyW + fMeasPerSystem*fMeasureW; const float kLineW = fClefKeyW + fMeasPerSystem*fMeasureW;
for (int system = 0; system<fNumSystems; ++system) { for (int system = 0; system<fNumSystems; ++system) {
const float kSystemY = [self systemY:system]; const float kSystemY = [self systemY:system];
if (!NSIntersectsRect(rect, NSRect systemRect = NSMakeRect(kLineX, kSystemY+kClefY, kLineW, kSystemH-kClefY);
NSMakeRect(kLineX, kSystemY+kClefY, if (!NSIntersectsRect(rect, systemRect))
kLineW, kSystemH-kClefY)
))
continue; // This system does not need to be drawn continue; // This system does not need to be drawn
// //
// When highlighting, draw highlight FIRST and then draw our stuff // When highlighting, draw highlight FIRST and then draw our stuff