Browse Source

cmGrPlot.c Added global wext assertion for HLines and VLines

master
kevin 11 years ago
parent
commit
f1e70ee42a
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      cmGrPlot.c

+ 11
- 0
cmGrPlot.c View File

@@ -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;

Loading…
Cancel
Save