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(shapes): fabric.Object._fromObject never should return #7201

Merged
merged 3 commits into from
Jul 16, 2021

Conversation

rockerBOO
Copy link
Contributor

fabric.Object._fromObject doesn't return anything, and is processed through the callback.

This removes the return and fixes the documentation. This is mostly to upstream this fix to Typescript types as it incorrectly thinks Polygon, Circle, Ellipse return an object.

Thank you!

@@ -74,7 +74,7 @@
* @param {Function} [callback] Callback to invoke when an fabric.Path instance is created
*/
fabric.Polygon.fromObject = function(object, callback) {
return fabric.Object._fromObject('Polygon', object, callback, 'points');
fabric.Object._fromObject('Polygon', object, callback, 'points');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add return void to this one too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@asturur
Copy link
Member

asturur commented Jul 16, 2021

Hi @rockerBOO thanks this is good. Can you address the comment?

@asturur
Copy link
Member

asturur commented Jul 16, 2021

Thank you for the contribution

@asturur asturur merged commit e6d16d3 into fabricjs:master Jul 16, 2021
@asturur asturur mentioned this pull request Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants