private static void UtilTest() { Rect r1 = Rect.MinMaxRect(0, 0, 3, 5); Rect r2 = Rect.MinMaxRect(1, 1, 6, 2); Rect u = AMenu.Union(r1, r2); UT.assert(u.x == 0 && u.y == 0 && u.width == 6f && u.height == 5f); UT.print("Union: " + u); }
public void UpdateBounds() { if (list.Size() == 0) { bounds = new Rect(); // no objects, no bounds } else { var it = list.Iterator(); it.Next(); bounds = it.Value().GetRelativeRect(); // start with the first object UT.print("UpdateBounds: rect " + it.Value().GetRelativeRect() + ", bounds " + bounds); while (it.Next()) { bounds = AMenu.Union(bounds, it.Value().GetRelativeRect()); UT.print("UpdateBounds: rect " + it.Value().GetRelativeRect() + ", bounds " + bounds); } } }