为什么下面的示例中没有出现第一个和第三个矩形?
看起来矩形一旦大小为零就被破坏了。
package tests.piccolo;
import org.piccolo2d.extras.PFrame;
import org.piccolo2d.nodes.PPath;
public class Try_EmptyRectangle {
public static void main(String[] args) {
new PFrame() {
@Override
public void initialize() {
PPath rect1 = PPath.createRectangle(0, 0, 0, 0);
PPath rect2 = PPath.createRectangle(0, 100, 1, 1);
PPath rect3 = PPath.createRectangle(0, 200, 1, 1);
getCanvas().getLayer().addChild(rect1);
getCanvas().getLayer().addChild(rect2);
rect1.setWidth(50);
rect1.setHeight(50);
rect2.setWidth(50);
rect2.setHeight(50);
rect3.setWidth(0);
rect3.setHeight(0);
rect3.setWidth(50);
rect3.setHeight(50);
}
};
}
}