refined rules for rectangles rendering in WebGL