Closed abit closed 10 years ago
I found out - something wrong with the Stroke Width
, if I set it bigger than 1 it doesn't show the line, if the thickness is 1, everything is normal
So, that was an old version of the fabric.js
library. Also, the new version has a bug (when creating a line). There is a workaround/fix for that. All info look here:
Well sleuthed! Is there anything you want me to take a look at?
everything is fine now. strange is that the version built and the version from the kitchensink are not the same. I have problems with the fabric.js build on my own, so I use now only from the kitchensink.
An offtopic question: how would you implement the deleteSelectedObject()
Functionality
?
@theozaurus: I created this, but it doesn't work:
DrawingFabric.Functionality.destroy = (function(){
return function(){
this.initialize = function(){
var that = this;
//var obj;
var handle = function(event){
//obj = that.fabricCanvas.getActiveObject();
//if(obj){
destroy()
//}
};
fabric.util.addListener(this.fabricCanvas.upperCanvasEl, 'destroy', handle);
};
};
}());
I also registered it in tools, but when I set a breakpoint on destroy() it never fires.
I've got some code that listens for the delete key to be pressed and deletes an object. That might help you get a bit further. Take a peek at the keyboard_commands.js
: https://github.com/theozaurus/drawing-fabric.js/blob/master/src/functionality/keyboard_commands.js#L27
When I create a drawing canvas:
and add a functionality to it:
and when I try to create a line, I get an error:
in the line 670 in drawing_fabric.js:
Also the selection on the canvas is not going away when I click again and again on it. Each click propagate the error above.
What is that 'tool()' and how to solve the problem with error?
On the demo page the Line also doesn't work, though no errors are appearing in the console.
P.S. I build the drawing_fabric.js from the ruby project cloned from here, and included the built js file into my project