0
爲什麼第一個和第三個矩形不出現在下面的示例中?無法在Piccolo2D中拉伸零矩形?
看起來像長方形是一旦它有零大小被打破。
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);
}
};
}
}