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

Possible to Delete Masks by Setting Property to Null #567

Merged
merged 8 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Updated Builds
  • Loading branch information
jonobr1 committed Nov 24, 2021
commit 71a9fd90fcedf7b5c77acf92a13b4c5a4877a345
41 changes: 36 additions & 5 deletions build/two.js
Original file line number Diff line number Diff line change
Expand Up @@ -1578,13 +1578,13 @@ SOFTWARE.
* @name Two.Version
* @property {String} - The current working version of the library.
*/
Version: 'v0.7.10',
Version: 'v0.7.11',

/**
* @name Two.PublishDate
* @property {String} - The automatically generated publish date in the build process to verify version release candidates.
*/
PublishDate: '2021-11-20T15:57:25.534Z',
PublishDate: '2021-11-24T18:02:03.466Z',

/**
* @name Two.Identifier
Expand Down Expand Up @@ -3478,9 +3478,12 @@ SOFTWARE.
},

set: function(v) {
if (this._mask) {
this._mask.clip = false;
}
this._mask = v;
this._flagMask = true;
if (!v.clip) {
if (v && !v.clip) {
v.clip = true;
}
}
Expand Down Expand Up @@ -3804,6 +3807,11 @@ SOFTWARE.
child.translation.y -= rect.top;
}

if (this.mask) {
this.mask.translation.x -= rect.left;
this.mask.translation.y -= rect.top;
}

return this;

},
Expand All @@ -3827,6 +3835,11 @@ SOFTWARE.
}
}

if (this.mask) {
this.mask.translation.x -= cx;
this.mask.translation.y -= cy;
}

return this;

},
Expand Down Expand Up @@ -7440,9 +7453,12 @@ SOFTWARE.
},

set: function(v) {
if (this._mask) {
this._mask.clip = false;
}
this._mask = v;
this._flagMask = true;
if (!v.clip) {
if (v && !v.clip) {
v.clip = true;
}
}
Expand Down Expand Up @@ -7814,6 +7830,13 @@ SOFTWARE.
v.y += hh;
}

if (this.mask) {
this.mask.translation.x -= cx;
this.mask.translation.x += hw;
this.mask.translation.y -= cy;
this.mask.translation.y += hh;
}

return this;

},
Expand All @@ -7836,6 +7859,11 @@ SOFTWARE.
v.y -= cy;
}

if (this.mask) {
this.mask.translation.x -= cx;
this.mask.translation.y -= cy;
}

return this;

},
Expand Down Expand Up @@ -10156,9 +10184,12 @@ SOFTWARE.
},

set: function(v) {
if (this._mask) {
this._mask.clip = false;
}
this._mask = v;
this._flagMask = true;
if (!v.clip) {
if (v && !v.clip) {
v.clip = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion build/two.min.js

Large diffs are not rendered by default.

41 changes: 36 additions & 5 deletions build/two.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -1572,13 +1572,13 @@ var Constants = {
* @name Two.Version
* @property {String} - The current working version of the library.
*/
Version: 'v0.7.10',
Version: 'v0.7.11',

/**
* @name Two.PublishDate
* @property {String} - The automatically generated publish date in the build process to verify version release candidates.
*/
PublishDate: '2021-11-20T15:57:25.534Z',
PublishDate: '2021-11-24T18:02:03.466Z',

/**
* @name Two.Identifier
Expand Down Expand Up @@ -3472,9 +3472,12 @@ _.extend(Group, {
},

set: function(v) {
if (this._mask) {
this._mask.clip = false;
}
this._mask = v;
this._flagMask = true;
if (!v.clip) {
if (v && !v.clip) {
v.clip = true;
}
}
Expand Down Expand Up @@ -3798,6 +3801,11 @@ _.extend(Group.prototype, Shape.prototype, {
child.translation.y -= rect.top;
}

if (this.mask) {
this.mask.translation.x -= rect.left;
this.mask.translation.y -= rect.top;
}

return this;

},
Expand All @@ -3821,6 +3829,11 @@ _.extend(Group.prototype, Shape.prototype, {
}
}

if (this.mask) {
this.mask.translation.x -= cx;
this.mask.translation.y -= cy;
}

return this;

},
Expand Down Expand Up @@ -7434,9 +7447,12 @@ _.extend(Path, {
},

set: function(v) {
if (this._mask) {
this._mask.clip = false;
}
this._mask = v;
this._flagMask = true;
if (!v.clip) {
if (v && !v.clip) {
v.clip = true;
}
}
Expand Down Expand Up @@ -7808,6 +7824,13 @@ _.extend(Path.prototype, Shape.prototype, {
v.y += hh;
}

if (this.mask) {
this.mask.translation.x -= cx;
this.mask.translation.x += hw;
this.mask.translation.y -= cy;
this.mask.translation.y += hh;
}

return this;

},
Expand All @@ -7830,6 +7853,11 @@ _.extend(Path.prototype, Shape.prototype, {
v.y -= cy;
}

if (this.mask) {
this.mask.translation.x -= cx;
this.mask.translation.y -= cy;
}

return this;

},
Expand Down Expand Up @@ -10150,9 +10178,12 @@ _.extend(Text, {
},

set: function(v) {
if (this._mask) {
this._mask.clip = false;
}
this._mask = v;
this._flagMask = true;
if (!v.clip) {
if (v && !v.clip) {
v.clip = true;
}
}
Expand Down