Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fabric.Group): willDrawShadow has to always take in account children items #6116

Merged
merged 2 commits into from
Jan 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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