Bladeren bron

cmGrPlot.c Added global wext assertion for HLines and VLines

master
kevin 12 jaren geleden
bovenliggende
commit
f1e70ee42a
1 gewijzigde bestanden met toevoegingen van 11 en 0 verwijderingen
  1. 11
    0
      cmGrPlot.c

+ 11
- 0
cmGrPlot.c Bestand weergeven

@@ -346,6 +346,17 @@ void _cmGrPlotObjGetVExt( cmGrPlotObj_t* op, cmGrVExt_t* vext )
346 346
         cmGrVExt_t wext;
347 347
         cmGrObjH_t oh = cmGrObjParent(op->grObjH);
348 348
         cmGrObjWorldExt(oh,&wext);
349
+
350
+        // TODO: Put a check somewhere which can report an error
351
+        // message when the parents world extent is not yet set.
352
+        // Horz and Vert lines depend on the their parent's
353
+        // world extents being set first.  There is no automatic
354
+        // way to set the parent world extents because we don't
355
+        // know the range of values which the data set will cover.
356
+        // Any number picked could result in a range much to large
357
+        // thereby leaving the data invisible.  It therefore must
358
+        // be up to the application to set a good range.
359
+        assert( cmGrVExtIsNotNullOrEmpty(&wext) );
349 360
         
350 361
         vext->loc.x = op->typeId==kHLineGrPlId ? wext.loc.x : op->vext.loc.x;
351 362
         vext->loc.y = op->typeId==kVLineGrPlId ? wext.loc.y : op->vext.loc.y;

Laden…
Annuleren
Opslaan