added getter and setter methods for pixel ratio. Also added unit tests

This commit is contained in:
Eric Rowell
2013-08-27 21:51:54 -07:00
parent 6663ec0652
commit c8936a4bc0
2 changed files with 38 additions and 2 deletions

View File

@@ -26,6 +26,21 @@ Test.Modules.CANVAS = {
stage.draw();
layer.getCanvas().setPixelRatio(1);
test(layer.getCanvas().getPixelRatio() === 1, 'pixel ratio should be 1');
test(layer.getCanvas().width === 289, 'canvas width should be 289');
test(layer.getCanvas().height === 100, 'canvas height should be 100');
layer.getCanvas().setPixelRatio(2);
test(layer.getCanvas().getPixelRatio() === 2, 'pixel ratio should be 2');
test(layer.getCanvas().width === 578, 'canvas width should be 578');
test(layer.getCanvas().height === 200, 'canvas height should be 200');
layer.draw();
}