Panner: Use appropriate backdrop when switching projections.

pull/116/head
Jonathan Moore Liles 2013-09-09 17:25:34 -07:00
parent 7f5e9f1e9b
commit a102d76912
2 changed files with 6 additions and 2 deletions

View File

@ -40,6 +40,7 @@ Panner::Panner ( int X, int Y, int W, int H, const char *L ) :
{
_bg_image = 0;
_bg_image_scaled = 0;
_bg_image_projection = 0;
_range = 15.0f;
// _projection = POLAR;
_points.push_back( Point( 1, 0 ) );
@ -189,7 +190,7 @@ Panner::draw_the_box ( int tx, int ty, int tw, int th )
Fl_Image *i = 0;
if ( _bg_image && _bg_image->h() != th )
if ( _bg_image && ( _bg_image->h() != th || projection() != _bg_image_projection ) )
{
if ( _bg_image_scaled )
delete _bg_image;
@ -233,6 +234,8 @@ Panner::draw_the_box ( int tx, int ty, int tw, int th )
_bg_image_scaled = false;
}
}
_bg_image_projection = projection();
if ( _bg_image )
_bg_image->draw( tx, ty );

View File

@ -35,7 +35,8 @@ class Panner : public Fl_Group
Fl_Image *_bg_image;
bool _bg_image_scaled;
int _bg_image_projection;
void draw_grid( int,int,int,int);
void draw_the_box( int, int, int, int );