コード例 #1
0
ファイル: Section.cs プロジェクト: shtspk/raskroy
        public CanFitInfo CanFit(decimal width, decimal height, bool canRotate)
        {
            CanFitInfo result = new CanFitInfo();

            if (width <= m_data.m_width && height <= m_data.m_height)
            {
                result.CanFit           = true;
                result.CanRotate        = canRotate && width <= m_data.m_height && height <= m_data.m_width;
                result.NeedRotate       = false;
                result.ExactMatchWidth  = width == m_data.m_width;
                result.ExactMatchHeight = height == m_data.m_height;
            }
            else if (canRotate && width <= m_data.m_height && height <= m_data.m_width)
            {
                result.CanFit           = true;
                result.CanRotate        = false;
                result.NeedRotate       = true;
                result.ExactMatchWidth  = width == m_data.m_height;
                result.ExactMatchHeight = height == m_data.m_width;
            }
            else
            {
                result.CanFit = false;
            }
            return(result);
        }
コード例 #2
0
ファイル: Section.cs プロジェクト: boussaffawalid/CutOptima
 public CanFitInfo CanFit(decimal width, decimal height, bool canRotate)
 {
     CanFitInfo result = new CanFitInfo();
     if (width <= m_data.m_width && height <= m_data.m_height)
     {
         result.CanFit = true;
         result.CanRotate = canRotate && width <= m_data.m_height && height <= m_data.m_width;
         result.NeedRotate = false;
         result.ExactMatchWidth = width == m_data.m_width;
         result.ExactMatchHeight = height == m_data.m_height;
     }
     else if (canRotate && width <= m_data.m_height && height <= m_data.m_width)
     {
         result.CanFit = true;
         result.CanRotate = false;
         result.NeedRotate = true;
         result.ExactMatchWidth = width == m_data.m_height;
         result.ExactMatchHeight = height == m_data.m_width;
     }
     else
     {
         result.CanFit = false;
     }
     return  result;
 }