optimize paintevent
fix comment in compress.c