Sprite: Adds margin functionality with setting

Fixes #1446.