浏览代码

cmGrPlot.c Added global wext assertion for HLines and VLines

master
kevin 12 年前
父节点
当前提交
f1e70ee42a
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11
    0
      cmGrPlot.c

+ 11
- 0
cmGrPlot.c 查看文件

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

正在加载...
取消
保存