From e9aca6809ef55c6dc568cd34604b09cfc15d3f36 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Mon, 27 Feb 2012 17:42:42 -0800 Subject: [PATCH] Keep number of rows on phrase canvas in sync with the number of patterns. --- src/gui/ui.fl | 4 ++++ src/pattern.C | 1 - src/phrase.C | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/ui.fl b/src/gui/ui.fl index 5b831bc..5ef2b1a 100644 --- a/src/gui/ui.fl +++ b/src/gui/ui.fl @@ -1168,6 +1168,10 @@ else if ( ! g ) 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_name_field->value( g->name() ); phrase_solo_button->value( g->mode() == SOLO ); diff --git a/src/pattern.C b/src/pattern.C index 892f0e4..7260ffd 100644 --- a/src/pattern.C +++ b/src/pattern.C @@ -34,7 +34,6 @@ signal pattern::signal_create_destroy; pattern::pattern ( void ) { - viewport.h = 32; viewport.w = 32; diff --git a/src/phrase.C b/src/phrase.C index da28640..516f051 100644 --- a/src/phrase.C +++ b/src/phrase.C @@ -28,7 +28,6 @@ signal phrase::signal_create_destroy; phrase::phrase ( void ) { - viewport.h = 32; viewport.w = 32; @@ -151,7 +150,7 @@ phrase::row_name ( int r ) const void 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 );