Keep number of rows on phrase canvas in sync with the number of patterns.

This commit is contained in:
Jonathan Moore Liles 2012-02-27 17:42:42 -08:00
parent c91f950612
commit e9aca6809e
3 changed files with 5 additions and 3 deletions

View File

@ -1168,6 +1168,10 @@ else
if ( ! g ) if ( ! g )
return; return;
g->viewport.y = 0;
g->viewport.h = pattern::patterns();
phrase_c->resize_grid();
phrase_c->changed_mapping();
phrase_number_spinner->value( g->number() ); phrase_number_spinner->value( g->number() );
phrase_name_field->value( g->name() ); phrase_name_field->value( g->name() );
phrase_solo_button->value( g->mode() == SOLO ); phrase_solo_button->value( g->mode() == SOLO );

View File

@ -34,7 +34,6 @@ signal <void> pattern::signal_create_destroy;
pattern::pattern ( void ) pattern::pattern ( void )
{ {
viewport.h = 32; viewport.h = 32;
viewport.w = 32; viewport.w = 32;

View File

@ -28,7 +28,6 @@ signal <void> phrase::signal_create_destroy;
phrase::phrase ( void ) phrase::phrase ( void )
{ {
viewport.h = 32; viewport.h = 32;
viewport.w = 32; viewport.w = 32;
@ -151,7 +150,7 @@ phrase::row_name ( int r ) const
void void
phrase::draw_row_names ( Canvas *c ) const phrase::draw_row_names ( Canvas *c ) const
{ {
for ( int y = 128; y-- ; ) for ( int y = viewport.h; y--; )
{ {
pattern *p = pattern::pattern_by_number( y + 1 ); pattern *p = pattern::pattern_by_number( y + 1 );