فهرست منبع

NormalizeRect before calculating

GSP 1 هفته پیش
والد
کامیت
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;