fixed that clipping rectangle sometimes did not intersect framebuffer, which lead to an error (closes #377)