hyperandroid / CAAT

Canvas Advanced Animation Toolkit
hyperandroid.github.com/CAAT
MIT License
727 stars 117 forks source link

Rendering wrong when use director.enableResizeEvents(CAAT.Director.RESIZE_PROPORTIONAL) #143

Closed necoco closed 10 years ago

necoco commented 11 years ago

I use the library in github's master (caat.js) When I use director.enableResizeEvents(CAAT.Director.RESIZE_PROPORTIONAL), Canvas is scaled correctly, but rendering seems not being scaled.

Here's my code:

window.onload = function(){
    var director = new CAAT.Director()
        .initialize(
        400,
        800,
        document.getElementById("game")
    );

    var scene = director.createScene();

    var circle = new CAAT.ShapeActor()
        .setLocation(20, 20)
        .setSize(60, 60)
        .setFillStyle('#ff0000')
        .setStrokeStyle('#000000')
        .enableDrag();

    scene.addChild(circle);

    director.enableResizeEvents(CAAT.Director.RESIZE_PROPORTIONAL);

    director.loop(60);
};
vincentbriglia commented 10 years ago

You have to use CAAT.Foundation.Director.RESIZE_PROPORTIONAL in the latest version 0.6 build 51 but it seems that enableResizeEvents is broken between 0.6.49 and 0.6.51

hyperandroid commented 10 years ago

Has been recently fixed. Thanks for reporting.