Skip to content

Commit

Permalink
fix(fabric.Group): willDrawShadow has to always take in account child…
Browse files Browse the repository at this point in the history
…ren items (#6116)
  • Loading branch information
asturur authored Jan 23, 2020
1 parent 07b569a commit b03af9c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Changelog

## [4.0.0-beta.4]

fix(fabric.Group): will draw shadow will call parent method. [#6116](https://github.com/fabricjs/fabric.js/pull/6116)

## [4.0.0-beta.3]

fix: control offset rendering code had extras `beginPath` that would clear all but not the last of them [#6114](https://github.com/fabricjs/fabric.js/pull/6114)
fix(controls): control offset rendering code had extras `beginPath` that would clear all but not the last of them [#6114](https://github.com/fabricjs/fabric.js/pull/6114)

## [4.0.0-beta.2]

fix: Control.getVisibility will always receive the fabric.Object argument.
fix(controls): Control.getVisibility will always receive the fabric.Object argument.

## [4.0.0-beta.1]

Expand Down
2 changes: 1 addition & 1 deletion HEADER.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */

var fabric = fabric || { version: '4.0.0-beta.3' };
var fabric = fabric || { version: '4.0.0-beta.4' };
if (typeof exports !== 'undefined') {
exports.fabric = fabric;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "fabric",
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
"homepage": "http://fabricjs.com/",
"version": "4.0.0-beta.3",
"version": "4.0.0-beta.4",
"author": "Juriy Zaytsev <[email protected]>",
"contributors": [
{
Expand Down
4 changes: 2 additions & 2 deletions src/shapes/group.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@
* @return {Boolean}
*/
willDrawShadow: function() {
if (this.shadow) {
return fabric.Object.prototype.willDrawShadow.call(this);
if (fabric.Object.prototype.willDrawShadow.call(this)) {
return true;
}
for (var i = 0, len = this._objects.length; i < len; i++) {
if (this._objects[i].willDrawShadow()) {
Expand Down
4 changes: 4 additions & 0 deletions test/unit/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,10 @@
assert.equal(group3.willDrawShadow(), true, 'group will cast shadow because group itself has shadow and one offsetX different than 0');
group3.shadow = { offsetX: 0, offsetY: -2 };
assert.equal(group3.willDrawShadow(), true, 'group will cast shadow because group itself has shadow and one offsetY different than 0');
rect1.shadow = { offsetX: 1, offsetY: 2, };
group3.shadow = { offsetX: 0, offsetY: 0 };
assert.equal(group3.willDrawShadow(), true, 'group will cast shadow because group itself will not, but rect 1 will');

});

QUnit.test('group shouldCache', function(assert) {
Expand Down

0 comments on commit b03af9c

Please sign in to comment.