mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Some more robustness against corrupt documents
This commit is contained in:
parent
b915085530
commit
c14ace59f8
|
@ -38,7 +38,7 @@ static size_t NextBreak(const VLSong & song, size_t after=0)
|
||||||
|
|
||||||
VLLayout::VLLayout(const VLSong & song, float width)
|
VLLayout::VLLayout(const VLSong & song, float width)
|
||||||
{
|
{
|
||||||
size_t nextBreak = NextBreak(song);
|
size_t nextBreak = song.fMeasures.empty() ? 0 : NextBreak(song);
|
||||||
for (size_t meas = 0; meas<song.fMeasures.size(); ) {
|
for (size_t meas = 0; meas<song.fMeasures.size(); ) {
|
||||||
push_back(VLSystemLayout(song.Properties(meas), width, nextBreak-meas));
|
push_back(VLSystemLayout(song.Properties(meas), width, nextBreak-meas));
|
||||||
meas += back().NumMeasures();
|
meas += back().NumMeasures();
|
||||||
|
|
|
@ -582,6 +582,9 @@ const char * sBreak[3] = {"", "\xE2\xA4\xBE", "\xE2\x8E\x98"};
|
||||||
|
|
||||||
- (void)drawRect:(NSRect)rect
|
- (void)drawRect:(NSRect)rect
|
||||||
{
|
{
|
||||||
|
if (![self song])
|
||||||
|
return;
|
||||||
|
|
||||||
if (fNeedsRecalc || [self inLiveResize] || [self song]->CountMeasures() != fLastMeasures) {
|
if (fNeedsRecalc || [self inLiveResize] || [self song]->CountMeasures() != fLastMeasures) {
|
||||||
[self recalculateDimensions];
|
[self recalculateDimensions];
|
||||||
rect = [self bounds];
|
rect = [self bounds];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user