Commit graph

283 commits

Author SHA1 Message Date
Kienz
be86429b32 Add reviver function to fabric.Canvas.toSVG.
Reviver function accepts one parameter (svg string representation of object instance) and should return svg string.
Add qunit test.
2013-09-29 09:22:44 +02:00
kangax
f2ad6e5be6 [BACK_INCOMPAT] Move "backgroundColor" from fabric.Text to fabric.Object (only works with text for now). Remove fabric.Object#overlayFill. Remove fabric.Canvas.toGrayscale, fabric.Object#toGrayscale, and fabric.Object#overlayFill. Version 1.3.5 2013-09-28 23:47:53 +02:00
kangax
83ca60e885 Fix resolveNamespace and getKlass on node 2013-09-24 13:25:38 +02:00
Kienz
cabc63c633 Fixed unit test 2013-09-20 22:38:37 +02:00
Stefan Kienzle
60e9d0f144 [BACK_INCOMPAT] Initialization of fabric.Image.filters.Tint is now different - options.color: color string value, options.opacity: 0..1
Now you can define opacity of the tint filter (by rgba/hsla colors or with opacity attribute)
Doc additions
2013-09-20 19:51:55 +02:00
Kienz
cb510b9ef3 Fixed fabric.Group.toSVG- object order was wrong 2013-09-18 19:17:50 +02:00
kangax
408a8b9de6 Alias "jpg" format to "jpeg". Closes #806 2013-09-14 18:44:44 +02:00
Kienz
26e784aede Move setColorfrom fabric.Text to fabric.Object
Fixed "enum" notation
`fabric.Object.setGradient` is now chainable
Doc additions
Add `fabric.Object.setPatternFill`unit test
Add chainable tests to some methods
2013-09-14 17:10:49 +02:00
Juriy Zaytsev
a7489774fd Merge pull request #840 from Kienz/patch-2
`fabric.Observable.on` and `fabric.Observable.off` can add/remove multiple handlers (object with key/value pairs). Closes #838
2013-09-12 14:49:31 -07:00
Kienz
1e1adc7831 fabric.Observable.on and fabric.Observable.off can add/remove multiple handlers (object with key/value pairs)
Update jsdoc
Add unit tests
2013-09-12 20:43:31 +02:00
Kienz
9f6dea5d9e Add reviver function to fabric.Canvas.loadFromJSON (and loadFromDatalessJSON)
Add unit test
2013-09-12 20:10:23 +02:00
kangax
5ebd697978 [BACK_INCOMPAT] Remove selectable, hasControls, hasBorders, hasRotatingPoint, transparentCorners, perPixelTargetFind from default object/json representation of objects. Fix includeDefaultValues. Version 1.2.13. Closes #795 2013-09-11 11:41:00 +02:00
Stefan Kienzle
d190c31e8b Renamed fabric.Shadow.getShadow to fabric.Shadow.toString 2013-09-05 18:09:34 +02:00
Juriy Zaytsev
ed1c116793 Merge pull request #823 from Kienz/patch-1
[BACK_INCOMPAT] `fabric.Text.textShadow`was removed and `fabric.BaseBrush` shadow properties removed (new `fabric.BaseBrush.shadow`)
2013-09-03 12:27:13 -07:00
kangax
4559918688 Resolve conflicts 2013-09-03 21:18:29 +02:00
Drew Lustro
1f993e92b8 requirejs support added via "requirejs" build.sh option
$ node build modules=ALL requirejs
- dist/all* is clean of changes
- fixed bug in build.sh that would prevent dist/all.require.js from compiling properly
- Updated test.js to include test_script.js fixtures
- NOTE: Qunit tests largely incompatible with requirejs version... need more
insight on how Qunit works to get fabric in the namespace since it is
no longer a global when built as an AMD module.
2013-09-03 14:15:12 -04:00
Kienz
8c74f2b335 [BACK_INCOMPAT] fabric.Text#textShadow has been removed - new fabric.Text.shadow property (type of fabric.Shadow)
[BACK_INCOMPAT] `fabric.BaseBrush`shadow properties are combined into one property => `fabric.BaseBrush.shadow`(shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY no longer exist)
Removed fabric.Text.getText method => is generated with `fabric.util.createAccessors`
`fabric.Shadow` can now initialized with string or object (e.g. '10px 10px 5px rgb(0,0,255)', 'rgb(0,0,255) 10px 10px 5px', {color: 'gb(0,0,255)', offsetX: 10, offsetY: 10, blur: 5})
`fabric.Shadow.getShadow`to get css3 declaration of shadow (String)
`fabric.Object.set('shadow', value)`is now the same as `fabric.Shadow.setShadow(value)`
Add unit tests
2013-09-03 19:11:21 +02:00
kangax
9539306a0e Add test for context in trigger 2013-09-03 11:53:10 +02:00
kangax
ec32a3c399 Make on/off/trigger chainable 2013-09-03 11:52:10 +02:00
kangax
191ce1aa69 Build distribution, fix unit test 2013-08-30 13:52:24 +02:00
Stefan Kienzle
89f3ab0668 Fix fabric.Circle.set for radius - update width/height if radius is set
Closes issue #811
2013-08-30 11:51:08 +02:00
Kienz
345ed3f5e9 Fix fabric.Text#fontFamily in SVG output - Closes issue #813
Add unit tests
2013-08-29 22:06:24 +02:00
kangax
434bfb2c6d Fix fabric.Canvas subclassing; fabric.Canvas, fabric.StaticCanvas now created via createClass. 2013-08-28 15:17:25 +02:00
Kienz
f31a62a25c Add encoding to canvas.toSVG(options)
Add unit tests for canvas.toSVG
2013-08-27 20:32:15 +02:00
kangax
78dc27a029 Call abort in context of an object. Closes #803 2013-08-23 14:30:33 +02:00
Kienz
026df90193 Add fabric.Image.filters.Mask unit test 2013-08-18 21:01:50 +02:00
Kienz
a61b384684 Add toJSON back to image filters
Add toJSON to unit tests
2013-08-09 20:37:56 +02:00
Kienz
f2035da955 Add image filter tests
Doc fixes
2013-08-09 19:59:30 +02:00
Stefan Kienzle
6599d393ac Fix fabric.Image.setElement - now _element and _originalElement (until now _originalImage) are set. Closes #745
Add additional parameter callback (invoked after filters habe been applied).
Fix `fabric.Image.fromObject` - don't overwrite image width/height with object width/height.
`fabric.Image.applyFilters` only resets _originalElement - fixes issue if object's width/height are different to _originaElement's width/height
[BACK_INCOMPAT] Renamed `fabric.Image.filters` method `toJSON` -> `toObject`
Fix serializiation of fabric.Image filter objects
2013-08-09 14:18:27 +02:00
Kienz
b63a943137 Renamed property renderOnAddition to renderOnAddRemove
fabric.Canvas.renderAll can now be disabled on removing objects (renderOnAddRemove = false)
Add tests for renderOnAddRemove (add, insertAt and remove)
jsdoc additions
2013-08-07 21:01:45 +02:00
kangax
67b54a44a5 Fix pattern toSVG 2013-07-22 22:00:03 +02:00
kangax
974ed943b8 Fix polyline, polygon tests and JSHint warnings 2013-07-22 14:39:07 +02:00
Kienz
c9d866dcf9 Fixed fabric.PathGroup.fromObject - use fabric.util.enlivenObjects to instatiate fabric.Path objects
Corrected jsdoc tags for fabric.PathGroup.fromObject, fabric.Path.fromObject and fabric.Path.fromElement
Fixed quint tests for fabric.Path and fabric.PathGroup
2013-07-18 22:21:19 +02:00
kangax
c8cab03aac [BACK_INCOMPAT] fabric.Path.fromObject is now async. fabric.Canvas#loadFromDatalessJSON is deprecated. 2013-07-12 22:38:21 +02:00
kangax
21f87bb63a Fix polygon/polyline tests and minor cleanup 2013-07-07 22:25:01 +02:00
kangax
33fd6c66b5 Version 1.2.1 2013-07-06 16:04:29 +02:00
Kienz
520b2258d3 Convert opacity value into float value. If stop-opacity is set as attribute (not as style attribute) el.getAttribute('stop-opacity') returns null. Problem exists since commit a0b7fa4eb9.
Add default value rgb(0,0,0) for stop-color and 1 for stop-opacity.
Add more gradient tests.
2013-07-02 21:09:50 +02:00
kangax
6597b8919b Make sure only existent custom properties included in output. Closes #713 2013-06-19 12:49:45 +02:00
Kienz
57de0f7f3a Add more tests to gradient (distinguish between linearGradient and radialGradient) 2013-06-18 22:34:18 +02:00
kangax
be8e921e57 Fix nested matrix multiplication. Closes #705 2013-06-13 23:10:33 +02:00
kangax
5bd8ba28d6 Fix loadFromJSON callback when objects array is empty. Closes #703 2013-06-13 13:39:17 +02:00
kangax
044f5ed483 Fix rect positioning when loading from JSON. Closes #522 2013-06-03 02:24:41 +02:00
kangax
5a28acb032 Fix toJSON/toSVG serialization when there's active group on canvas. Closes #645 2013-06-03 01:55:51 +02:00
kangax
2407dbba49 Implement clipTo serialization, deserialization, and initialization. Closes #583. Closes #677. Closes #676 2013-06-02 23:04:54 +02:00
kangax
221146997c Fix pattern initialization from function string. Closes #442. Version 1.1.18 2013-06-02 22:07:16 +02:00
kangax
1c1b7e4b95 Fix function body matching regex. Add fabric.util.getFunctionBody 2013-06-01 18:08:36 +02:00
Kienz
2c29c0cfab Fix typo, add hsl/hsla (with whitespaces) unit tests and move stuff outside of functions 2013-05-25 19:42:31 +02:00
Kienz
1ba6d1345e Merge remote-tracking branch 'origins/master' into parseSVGOpacity 2013-05-25 11:32:59 +02:00
Kienz
66fc8f4d4b Parse SVG stroke-opacity and fill-opacity
- SVG attribute opacity is now used for object's opacity
- fill-opacity and stroke-opacity are added to stroke and fill color value
- Add hsl/hsla support (e.g. hsl(270, 80%, 10%), hsla(320, 10%, 66%, 0.5))
- Add support for rgb/rgba values with whitespaces around values (e.g. rgba( 255 , 100 , 50 , 0.1 )) and percentage values (e.g. rgb(100%, 67%, 15%, 0.8))
- Delete stroke and strokeWidth from fabric.Text (defined in fabric.Object)
- New unit test for parse stroke-opacity and fill-opacity
- Update unit tests (new tests for hsl/hsla and rgb/rgba (whitespaces and percentage values))
- Change equal and deepEqual parameter order (e.g. equal(actualValue, expectedValue, message))
- Doc additions
2013-05-25 11:03:09 +02:00
kangax
d23cbcbb3a Fix unit tests 2013-05-23 20:16:08 +02:00