1. Move layer locking code after the shape creation - the stroke and fill can be applied to drawing objects.
2. Update IsMagnetTarget() function.