浏览代码

NormalizeRect before calculating

GSP 3 周之前
父节点
当前提交
b46c37522b
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      OTSCPP/OTSImagePro/FieldMgr.cpp

+ 6 - 3
OTSCPP/OTSImagePro/FieldMgr.cpp

@@ -279,10 +279,13 @@ namespace OTSIMGPROC {
 		sizeImage.cy = effectiveHeight;
 		// start mode
 		OTS_GET_IMAGE_MODE nStartMode = (OTS_GET_IMAGE_MODE)m_fieldStartMode;
-			
+		rectMeasureDomain.NormalizeRect();
+		int height = (ceil((double)rectMeasureDomain.Height()));
+		int width = (ceil((double)rectMeasureDomain.Width()));
+		
 			// calculate total columns, rows and make sure the domain area be covered
-			int nTotalCols = (int)(ceil((double)rectMeasureDomain.Width() / effectiveWidth));
-			int nTotalRows = (int)(ceil((double)rectMeasureDomain.Height() / effectiveHeight));
+			int nTotalCols = (int)(width/ effectiveWidth);
+			int nTotalRows = (int)(height / effectiveHeight);
 
 			// calculate column on the left of the centre point
 			int nLeftCols = nTotalCols / 2;