Fix renderer to account for margins