cmGrPlotAudio.c Fixed bug which caused audio files that went out of view on zoom to be redrawn in their pre-zoom position.

This commit is contained in:
kevin 2012-12-17 14:49:54 -08:00
parent 64831fef9f
commit 2fddbbb745

View File

@ -28,13 +28,13 @@ typedef struct
cmGrIsInsideObjCb_t isInsideCbFunc; cmGrIsInsideObjCb_t isInsideCbFunc;
void* isInsideCbArg; void* isInsideCbArg;
void* mem; void* mem; //
cmGrPExt_t pext; cmGrPExt_t pext; // extents of the visible portion of this audio object
unsigned pixN; unsigned pixN; // count of pixel columns used by this audio object
cmSample_t* fMinV; cmSample_t* fMinV; // fMinV[pixN] = min sample value for each visible column
cmSample_t* fMaxV; cmSample_t* fMaxV; // fMaxV[pixN] = max sample value for each visible column
int* iMinV; int* iMinV; // iMinV[pixN] = top pixel for each column line
int* iMaxV; int* iMaxV; // iMaxV[pixN] = bottom pixel for each column line
} cmGrPlObjAf_t; } cmGrPlObjAf_t;
@ -50,7 +50,12 @@ cmGrPlRC_t _cmGrPlObjAfCalcImage( cmGrPlObjAf_t* op, cmGrH_t grH )
cmGrVExtIntersect(&drExt,&vwExt,&objExt); cmGrVExtIntersect(&drExt,&vwExt,&objExt);
// if the audio object is visible // if the audio object is visible
if( cmGrVExtIsNotNullOrEmpty(&drExt) ) if( cmGrVExtIsNullOrEmpty(&drExt) )
{
cmGrPExtSetNull(&op->pext);
op->pixN = 0;
}
else
{ {
// get the extents of the visible portion of the audio object // get the extents of the visible portion of the audio object
cmGrVExt_VtoP( grH, cmGrPlotObjHandle(op->oH), &drExt, &op->pext); cmGrVExt_VtoP( grH, cmGrPlotObjHandle(op->oH), &drExt, &op->pext);