Browse Source

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

master
kevin 11 years ago
parent
commit
2fddbbb745
1 changed files with 13 additions and 8 deletions
  1. 13
    8
      cmGrPlotAudio.c

+ 13
- 8
cmGrPlotAudio.c View File

@@ -28,13 +28,13 @@ typedef struct
28 28
   cmGrIsInsideObjCb_t isInsideCbFunc;
29 29
   void*               isInsideCbArg;
30 30
 
31
-  void*       mem;
32
-  cmGrPExt_t  pext;
33
-  unsigned    pixN;
34
-  cmSample_t* fMinV;
35
-  cmSample_t* fMaxV;
36
-  int*        iMinV;
37
-  int*        iMaxV;
31
+  void*       mem;   //
32
+  cmGrPExt_t  pext;  // extents of the visible portion of this audio object
33
+  unsigned    pixN;  // count of pixel columns used by this audio object
34
+  cmSample_t* fMinV; // fMinV[pixN] = min sample value for each visible column
35
+  cmSample_t* fMaxV; // fMaxV[pixN] = max sample value for each visible column
36
+  int*        iMinV; // iMinV[pixN] = top pixel for each column line 
37
+  int*        iMaxV; // iMaxV[pixN] = bottom pixel for each column line
38 38
 
39 39
 } cmGrPlObjAf_t;
40 40
 
@@ -50,7 +50,12 @@ cmGrPlRC_t _cmGrPlObjAfCalcImage( cmGrPlObjAf_t* op, cmGrH_t grH )
50 50
   cmGrVExtIntersect(&drExt,&vwExt,&objExt);
51 51
 
52 52
   // if the audio object is visible
53
-  if( cmGrVExtIsNotNullOrEmpty(&drExt) )
53
+  if( cmGrVExtIsNullOrEmpty(&drExt) )
54
+  {
55
+    cmGrPExtSetNull(&op->pext);
56
+    op->pixN = 0;
57
+  }
58
+  else
54 59
   {
55 60
     // get the extents of the visible portion of the audio object
56 61
     cmGrVExt_VtoP( grH, cmGrPlotObjHandle(op->oH), &drExt, &op->pext);

Loading…
Cancel
Save