Commit graph

221 commits

Author SHA1 Message Date
Kienz
61f65bc206 Fix path regExp for compressed path commands
Fix regExp for e^x numbers
Add unit test for e^x numbers
2014-01-12 13:50:03 +01:00
kangax
448dfad97e Fix unit tests 2014-01-04 15:02:51 -05:00
kangax
ea811cbb23 Fix fabric.Path#path being "cloned" by reference 2013-12-31 09:29:14 -05:00
kangax
dbd9193703 Debounce element parsing. Thanks @biovisualize. Closes #1052 2013-12-14 12:19:54 +01:00
Kienz
fd3ace05bb [BACK_INCOMPAT] Possibility to remove multiple fabric.Objects from collection (canvas, group) - this (canvas, group or object) is returned instead of delete object
Update unit tests - use strictEqual for some cases
Add multiple objects raised `object:added` for last added object first - now 1st added object raises 1st `object:added` event, 2nd object raises 2nd `object:added`…
2013-12-07 11:07:46 +01:00
kangax
b189645bba Fix unit test 2013-11-25 21:57:32 +01:00
kangax
ae11740f82 Fix i-text style copy-pasting (doesn't work with multiline yet) 2013-11-25 21:32:00 +01:00
kangax
f84ac95f75 fix test 2013-11-25 16:53:31 +01:00
kangax
4950e35627 Add remaining i-text unit tests 2013-11-25 16:39:50 +01:00
kangax
1075ed0851 Even more i-text unit tests 2013-11-23 19:33:48 +01:00
kangax
58464d4773 More i-text unit tests 2013-11-23 19:28:12 +01:00
kangax
3abe2f74f3 Add expect(0) 2013-11-23 17:49:21 +01:00
kangax
854d428c38 Add more tests 2013-11-23 17:35:31 +01:00
kangax
82509dc8d8 More IText tests 2013-11-23 13:45:53 +01:00
kangax
673fa39eba Start adding i-text unit tests; add additional util and color tests 2013-11-22 17:30:55 +01:00
Kienz
d4b2ea18b7 Fix center methods for object’s with different originX/originY
object.center() only re-renders canvas once instead of twice
Update unit tests
2013-11-20 20:41:13 +01:00
Kienz
67fd4253f3 Fix unit tests 2013-11-20 19:47:30 +01:00
kangax
ffe6091dd7 Move getObjects to fabric.Collection. Add support for getObjects(type). Version 1.3.10. 2013-11-09 14:50:30 +01:00
Kienz
42935be697 Remove activeObject in fabric.Canvas#remove
Fire 'before:selection:cleared' and 'selection:cleared' if activeObject is removed from canvas
Add unit test

Fixes issue #962
2013-11-08 19:09:16 +01:00
kangax
d0abb90f1c Add fabric.Image#crossOrigin which allows crossOrigin image loading and canvas rendering without tainting. fabric.util.loadImage now accepts 4th argument (crossOrigin) and sets crossOrigin="" on image element by default. fabric.Image.fromURL can be passed crossOrigin via 3rd argument (options). Closes #263 2013-11-05 15:13:15 +01:00
Juriy Zaytsev
fe54615584 Merge pull request #931 from lorenzopolidori/controls-visibility
Added object controls visibility. Closes #552.
2013-11-03 15:28:19 -08:00
kangax
330784ac2c [BACK_INCOMPAT] Change default objects' originX/originY to left/top 2013-11-04 00:15:49 +01:00
Lorenzo Polidori
d1642c0729 Added object controls visibility (github issue #552). 2013-11-03 23:08:05 +00:00
Kienz
5017bc6626 [BACK_INCOMPAT] fabric.StaticCanvas#backgroundImage and fabric.StaticCanvas#overlayImage are fabric.Image instances. fabric.StaticCanvas#backgroundImageOpacity, fabric.StaticCanvas#backgroundImageStretch, fabric.StaticCanvas#overlayImageLeft and fabric.StaticCanvas#overlayImageTop were removed.
`backgroundImage` and `overlayImage` are now `fabric.Image` instances
New property `overlayColor` (analog to `backgroundColor`) - should be set with `canvas.setOverlayColor`
`backgroundImageOpacity` was removed => use `fabric.Image#opacity`
`overlayImageLeft ` was removed => use `fabric.Image#left`
`overlayImageTop ` was removed => use `fabric.Image#top`
`backgroundImageStretch` was removed => use `fabric.Image#width` and `fabric.Image#height`. If you scale your canvas you have to adjust the backgroundImage width/height manually.
Update SVG output.
Add 2nd parameter `firstLetterOnly` to `fabric.util.string.capitalize` => only first letter is transformed to uppercase (other letters stay untouched)
Add `preserveAspectRatio="none"` to `fabric.Image#toSVG` (otherwise streched backgroundImage and overlayImage didn't work as expected)
Update examples - TODO: Update jsfiddles for `setBackgroundImage` and `setOverlayImage`
Add unit test

Closes issue #270
2013-11-03 13:09:49 +01:00
Kienz
6f115bbf1e Fix fabric.util.enlivenObjects for empty fabric.Group objects
Add unit test
Fixes issue #943
2013-11-02 16:02:38 +01:00
kangax
c6ff46269c Preserve canvas reference in fabric.Object#toDataURL. Closes #938 2013-10-31 16:00:31 +01:00
Alex Chuchunkov
a6f8e16c81 stopObserving w/o arguments removes all event - handler pairs. Closes issue #936 2013-10-29 22:47:29 +04:00
kangax
ae5973676a Support includeDefaultValues in shadow serialization 2013-10-25 09:05:39 +02:00
Kienz
14d053e9b2 Fix unit test 2013-09-29 10:21:55 +02:00
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
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