public void MovePrimToFront(Primitive prim) { var lastPrim = primitives.Last<Primitive>(); ZIndexCommand zIndexCommand = new ZIndexCommand(primitives, prim, prim.z, lastPrim.z + 1); commands.Add(zIndexCommand); zIndexCommand.Do(); }
public void MovePrimForward(Primitive prim) { Primitive nextPrim; int nextPrimIndex = primitives.IndexOf(prim) + 1; if(nextPrimIndex < 0 || nextPrimIndex >= primitives.Count) { return; } nextPrim = primitives[nextPrimIndex]; ZIndexCommand zIndexCommand = new ZIndexCommand(primitives, prim, prim.z, nextPrim.z, nextPrim, nextPrim.z, prim.z); commands.Add(zIndexCommand); zIndexCommand.Do(); }
public void MovePrimToBack(Primitive prim) { var firstPrim = primitives.First<Primitive>(); ZIndexCommand zIndexCommand = new ZIndexCommand(primitives, prim, prim.z, firstPrim.z - 1); commands.Add(zIndexCommand); zIndexCommand.Do(); }
public void MovePrimBackward(Primitive prim) { Primitive prevPrim; int prevPrimIndex = primitives.IndexOf(prim) - 1; if (prevPrimIndex < 0 || prevPrimIndex >= primitives.Count) { return; } prevPrim = primitives[prevPrimIndex]; ZIndexCommand zIndexCommand = new ZIndexCommand(primitives, prevPrim, prevPrim.z, prim.z, prim, prim.z, prevPrim.z); commands.Add(zIndexCommand); zIndexCommand.Do(); }