الخميس، 26 ديسمبر 2013

Fabric - render OverlayImage code raise Type Error

The fiddle is here : http://jsfiddle.net/mC4jM/

var canvas = new fabric.Canvas ("c2");canvas.backgroundColor = "#ddd";canvas.add(new fabric.Circle({ radius: 30, fill: '#f55', top: 100, left: 100 }));canvas.setOverlayImage('http://jsfiddle.net/img/logo.png', canvas.renderAll.bind(canvas));

When you select area of the canvas, it will raise Type Error, and google chrome indicates its at line 5853 in fabric.js:

ctx.drawImage(this.overlayImage, this.overlayImageLeft, this.overlayImageTop);

I used fabric.js 1.4.0 and tested in google chrome and FF.

Uncaught TypeError: Type error fabric.StaticCanvas.fabric.util.createClass.renderTop fabric.util.object.extend.__onMouseMove fabric.util.object.extend._onMouseMove

View the original article here

ليست هناك تعليقات:

إرسال تعليق