Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mutiple reload image on ios12 platform will be crash and the image will not show #1077

Open
by2017 opened this issue Nov 29, 2018 · 0 comments

Comments

@by2017
Copy link

by2017 commented Nov 29, 2018

// version=5.1.1
var urls = [
"imge1",
"imge2",
"imge3",
"imge1",
"imge2",
"imge3",
]
var echo =0;
var stage;
init();
$("#ontainer").on("touchstart", function(e) {
});
$("#ontainer").on("touchmove", function(e) {
});
$("#ontainer").on("touchend", function(e) {
init();
});
function init() {
var imageUrl = urls[echo];
var stage = new Kinetic.Stage({
container: 'container',
width: 729,
height: 294
});
var layer = new Kinetic.Layer();
var imageObj = new Image();
imageObj.src = imageUrl;
imageObj.onload = function() {
setTimeout(function(){
var yoda = new Kinetic.Image({
x: 200,
y: 200,
image: imageObj,
width: 106,
height: 118
});
layer.add(yoda);
stage.add(layer);
layer.draw();

                $("#test").empty();
                $("#test").append(imageObj);
                // $("#img1").attr("src", imageUrl);

                var canvas = document.getElementById("canvas");
                var ctx = canvas.getContext('2d')
                ctx.drawImage(imageObj, 0, 0)
                echo += 1;
                if (echo > 11) {
                    echo = 0;
                }
            }, 1000);
        };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant