I have:
var current_image_;
var canvas_;
canvas_ = new fabric.Canvas('myid');
canvas_.renderOnAddRemove = false;
function LoadImage(path)
{
fabric.Image.fromURL(path, function(oImg) {
// Something
current_image_ = oImg;
});
Draw();
}
// Other things
function Draw()
{
canvas_.clear();
canvas_.add(current_image_);
canvas_.renderAll();
}
current_image_
is Always a null reference. Why? In fact it doesn't render anything.
I just want to try to render in certain times the Whole scene, but I felt in error.
Thanks!