public int Fits(RectClass bigger, bool allowflip) { if (RectPackHelper.EqE(Width, bigger.Width, 0.00001) && RectPackHelper.EqE(Height, bigger.Height, 0.00001)) { return(3); } if (allowflip && RectPackHelper.EqE(Width, bigger.Height, 0.00001) && RectPackHelper.EqE(Height, bigger.Width, 0.00001)) { return(4); } if (Width <= bigger.Width && Height <= bigger.Height) { return(1); } if (allowflip && Width <= bigger.Height && Height <= bigger.Width) { return(2); } return(0); }
public int Fits(RectClass bigger) { if (RectPackHelper.EqE(Width(), bigger.Width(), 0.00001) && RectPackHelper.EqE(Height(), bigger.Height(), 0.00001)) { return(3); } if (RectPackHelper.EqE(Width(), bigger.Height(), 0.00001) && RectPackHelper.EqE(Height(), bigger.Width(), 0.00001)) { return(4); } if (Width() <= bigger.Width() && Height() <= bigger.Height()) { return(1); } if (Width() <= bigger.Height() && Height() <= bigger.Width()) { return(2); } return(0); }