ADD: class SmartPointer added to fix a bug from drawing figures larger than the active layer.