             layer.path = builder.end()
             layers.removeRange(index..<layers.count)
             layers.append(layer)
-            renderLayers(index...index)
-            index += 1
-            updateUI()
+            redo()
         default:
             shapeLayer.path = nil
         }

        layer.lineWidth = 30 / xform.a
        layer.fillColor = UIColor.clearColor().CGColor
        layer.strokeColor = UIColor(red: 1, green: 0, blue: 1, alpha: 1).CGColor
        layer.shadowRadius = 2.0
        layer.shadowColor = layer.strokeColor
        layer.shadowOpacity = 1.0
        layer.shadowOffset = CGSize.zero

            layer.removeFromSuperlayer()
        }
        layers.removeAll()
        imageCache.removeAll()
        index = 0
        imageView.image = image
        setTransformAnimated(CGAffineTransformIdentity)
