Comment #2 on issue 137 by allain.lalonde: Calling toImage() on a composite
node often returns an empty image.
http://code.google.com/p/piccolo2d/issues/detail?id=137
Failing test is:
public void testToImageUsesFullBoundsWhenConvertingImage() throws
IOException {
node.setBounds(0, 0, 50, 50);
PNode child1 = new PNode();
child1.setBounds(0, 0, 100, 50);
child1.setPaint(Color.RED);
node.addChild(child1);
PNode child2 = new PNode();
child2.setBounds(0, 0, 50, 100);
child2.setPaint(Color.BLUE);
node.addChild(child2);
BufferedImage image = (BufferedImage) node.toImage();
assertNotNull(image);
assertEquals(100, image.getWidth());
assertEquals(100, image.getHeight());
assertEquals(Color.RED.getRGB(), image.getRGB(99, 1));
assertEquals(Color.BLUE.getRGB(), image.getRGB(1, 99));
}
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
-~----------~----~----~----~------~----~------~--~---