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); }
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; }