Do not draw lines or polygons if they are hidden

This fixes #78