Commit graph

25 commits

Author SHA1 Message Date
kangax
581d5a54b9 Fix compatibility with Node (including loadSVGFromString). 2012-07-31 20:55:49 +02:00
kangax
57484274ba Fabric events related to objects can now be observed on objects themselves.
For example, instead of:

canvas.observe('object:selected', function(o) {
  console.log('selected', o.target);
})

you can now do:

object.on('selected', function() {
  console.log('selected', object);
});

Events that are fired on objects are:

- mouseup
- mousedown
- mousemove

- rotating
- scaling
- moving

- modified
- selected

- added
2012-07-18 18:29:27 +02:00
kangax
ae45281d18 Fix setBackgroundImage option setting. 2012-07-09 19:02:24 +02:00
kangax
b669085c97 Fix groups being lost after toDataURLWithMultiplier. 2012-06-26 16:41:43 +02:00
kangax
9926d8389a [BACK_INCOMPAT] Remove CANVAS_WIDTH, CANVAS_HEIGHT properties from fabric.Canvas.prototype (as they're no longer used anywhere). Lowercase some of the fabric.Canvas.prototype properties, for consistency: CURSOR -> defaultCursor, ROTATION_CURSOR -> rotationCursor, HOVER_CURSOR -> hoverCursor, CONTAINER_CLASS -> containerClass. 2012-06-23 00:18:41 +02:00
kangax
d6f7c9effb fabric.Canvas#setOverlayImage now correctly returns a reference to a canvas instance. 2012-06-19 20:33:46 +02:00
kangax
bb389e4723 Removing active object now fires "selection:cleared" events. Closes #121. 2012-06-07 12:47:15 +02:00
kangax
9130ab7f60 Add "object:added" event. Fires when object is added to canvas (either via canvas.add or canvas.insertAt). 2012-06-07 12:32:58 +02:00
kangax
c7f31d9d0e Export backgroundImage, backgroundImageOpacity, backgroundImageStretch in SVG. Closes #125. 2012-05-16 15:25:18 +04:00
kangax
9584ae2759 "backgroundImage", "backgroundImageOpacity", and "backgroundImageStretch" are now preserved correctly (when saving canvas to JSON/loading from JSON). Closes #139. 2012-05-16 14:51:10 +04:00
kangax
5a2eb2e3df [BACK_INCOMPAT] fabric.Canvas#getContext now returns context of canvas element on which all objects are drawn. fabric.Canvas#getSelectionContext returns context of canvas element on which object selection is drawn. 2012-05-13 18:30:12 +04:00
kangax
cba1d4ca21 [BACK_INCOMPAT] Move object straightening methods into its own, optional module (fabric.Object#straighten, fabric.Object.fxStraighten, fabric.Canvas#straightenObject). 2012-05-11 15:31:30 +04:00
kangax
6aef8a009d Fix bug where static canvas couldn't render overlay image. 2012-04-20 13:37:47 +02:00
kangax
6cdee94cc6 Fix typo in docs. 2012-03-29 15:35:58 +02:00
Tim de Koning
513766d63c fixed issue where canvas is messed up when no backgroundImage or backgroundColor is configured and something is dragged around on the canvas. 2012-02-09 11:00:30 +01:00
kangax
e5d92f71d5 Check that allOnTop is true not just any truthy value (so that we can pass it as callback to methods like "onChange"). See https://github.com/kangax/fabric.js/pull/104#issuecomment-3493677 2012-02-05 13:54:58 -05:00
Juriy Zaytsev
7169b53a46 Merge pull request #109 from gburlet/bgImg
Add "backgroundImageStretch" and "backgroundImageOpacity" options to canvas.
2012-02-05 10:48:50 -08:00
kangax
19dbb74307 Fix trailing commas. Closes #118. 2012-02-03 09:18:35 -05:00
Gregory Burlet
29e128faa0 variable name changes
changed backgroundOpacity to backgroundImageOpacity etc.
2012-01-27 09:19:40 -05:00
Gregory Burlet
78c2345bb8 added options for setBackgroundImage
optional arguments to the function can be supplied
2012-01-23 12:20:34 -05:00
Gregory Burlet
136539f9d9 background image changes
Allow the user to set the background image opacity, and whether the image should be stretched to fit the canvas
2012-01-23 11:48:37 -05:00
Tim de Koning
3795149dda Allow excanvas to kick in for IE8 and lower 2012-01-18 10:01:34 +01:00
kangax
d870410a7d First (and almost complete) implementation of fabric.Canvas#toSVG. 2012-01-02 16:14:20 -05:00
kangax
d72fceb14b Documentation tweaks. 2011-12-08 09:44:05 -05:00
kangax
b8ea6b7cec [BACK_INCOMPAT] Add support for static canvases — fabric.StaticCanvas. fabric.Canvas#loadImageFromURL -> fabric.util.loadImage. Add fabric.Canvas#centerObject. 2011-11-27 23:57:28 -05:00