javascript - Cannot use getActiveObject() in Fabric.js -
i want check image quality of selected image on canvas.
my following code:
var canvas = $(".canvas-container").children('canvas').get(0); //console.log(canvas.getactiveobject().get('type')); console.log(canvas);
the getactiveobject() log gives error: undefined not function.
the other log returns:
<canvas class="lower-canvas" width="850" height="230" style="position: absolute; width: 850px; height: 230px; left: 0px; top: 0px; -webkit-user-select: none;"></canvas>
the canvas created in js file:
//create fabric stage var canvas = $productstage.children('canvas').get(0); stage = new fabric.canvas(canvas, { selection: false, hovercursor: 'pointer', rotationcursor: 'default', controlsaboveoverlay: true, centeredscaling: true });
what must change can use can use canvas.getactiveobject()?
see http://www.panel-it.eu/shop/straatnaambord-3/# reference.
thanks in advance.
getactiveobject()
method of fabric.canvas object.
with above code, use stage.getactiveobject()
instead of canvas.getactiveobject()
Comments
Post a Comment