Graphics的drawRect方法中,width和height要求都是正的。根据需要把drawRect重写,允许负值。尝试用子类继承Graphics,但不知道怎么调用,有哪位知道的吗?
你自定义类继承Graphics,然后重写drawRect方法。加一个@Override就是重写的意思了。