mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-18 18:41:08 +00:00
Merge pull request #1427 from asturur/shadow-return-null
Update shadow.class.js - `objects.setShadow(null)` removes the sahdow Closes #1422
This commit is contained in:
commit
50e3fd717c
3 changed files with 7 additions and 1 deletions
|
|
@ -64,6 +64,7 @@
|
|||
* @return {fabric.Shadow} thisArg
|
||||
*/
|
||||
initialize: function(options) {
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = this._parseShadow(options);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1304,7 +1304,7 @@
|
|||
* canvas.renderAll();
|
||||
*/
|
||||
setShadow: function(options) {
|
||||
return this.set('shadow', new fabric.Shadow(options));
|
||||
return this.set('shadow', options ? new fabric.Shadow(options) : null);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1075,6 +1075,11 @@ test('toDataURL & reference to canvas', function() {
|
|||
equal(object.shadow.blur, 10);
|
||||
equal(object.shadow.offsetX, 5);
|
||||
equal(object.shadow.offsetY, 15);
|
||||
|
||||
equal(object.setShadow(null), object, 'should be chainable');
|
||||
ok(!(object.shadow instanceof fabric.Shadow));
|
||||
equal(object.shadow, null);
|
||||
|
||||
});
|
||||
|
||||
test('set shadow', function() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue