Переглянути джерело

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 роки тому
джерело
коміт
2fddbbb745
1 змінених файлів з 13 додано та 8 видалено
  1. 13
    8
      cmGrPlotAudio.c

+ 13
- 8
cmGrPlotAudio.c Переглянути файл

28
   cmGrIsInsideObjCb_t isInsideCbFunc;
28
   cmGrIsInsideObjCb_t isInsideCbFunc;
29
   void*               isInsideCbArg;
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
 } cmGrPlObjAf_t;
39
 } cmGrPlObjAf_t;
40
 
40
 
50
   cmGrVExtIntersect(&drExt,&vwExt,&objExt);
50
   cmGrVExtIntersect(&drExt,&vwExt,&objExt);
51
 
51
 
52
   // if the audio object is visible
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
     // get the extents of the visible portion of the audio object
60
     // get the extents of the visible portion of the audio object
56
     cmGrVExt_VtoP( grH, cmGrPlotObjHandle(op->oH), &drExt, &op->pext);
61
     cmGrVExt_VtoP( grH, cmGrPlotObjHandle(op->oH), &drExt, &op->pext);

Завантаження…
Відмінити
Зберегти