clip graphics to avoid segfault
clip graphics to avoid segfault