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

export Transfor Matrix in toObject #2350

Merged
merged 3 commits into from Jul 20, 2015
Merged

export Transfor Matrix in toObject #2350

merged 3 commits into from Jul 20, 2015

Conversation

asturur
Copy link
Member

@asturur asturur commented Jul 17, 2015

closes #2333

Do not really know if we should export everything, but transformMatrix is crucial when exporting pathGroups.

@asturur
Copy link
Member Author

asturur commented Jul 17, 2015

Other proposed solution:

PathGroup.toObject changes:

    toObject: function(propertiesToInclude) {
      !propertiesToInclude && propertiesToInclude = [ ];
      propertiesToInclude.push('transformMatrix');
      var o = extend(parentToObject.call(this, propertiesToInclude), {
        paths: invoke(this.getObjects(), 'toObject', propertiesToInclude)
      });
      if (this.sourcePath) {
        o.sourcePath = this.sourcePath;
      }
      return o;
    },

@asturur
Copy link
Member Author

asturur commented Jul 17, 2015

@kangax what do you say?

@kangax
Copy link
Member

kangax commented Jul 17, 2015

It's the kind of property that affects object representation (not controls or behavior) so we should definitely export it!

@asturur
Copy link
Member Author

asturur commented Jul 20, 2015

@kangax you can merge now.

All tests are passing but not this:

Module: fabric.Image Test: crossOrigin
toObject should return proper crossOrigin value
    at /home/travis/build/kangax/fabric.js/test/unit/image.js:182:7
    at /home/travis/build/kangax/fabric.js/test/unit/image.js:58:7
    at /home/travis/build/kangax/fabric.js/test/unit/image.js:75:21
    at fs.js:272:14
    at Object.oncomplete (fs.js:108:15)
Actual value:
undefined
Expected value:

This is because of the latest commit i was discussing with you.
So i'm not fixing this test as of now, waiting for you.
i still belive you introducd some breaking changes because those properties you removed ( crossOrigin, alignX, alignY and meetOrSlice are not handled by any export function anymore ).

kangax added a commit that referenced this pull request Jul 20, 2015
export Transfor Matrix in toObject
@kangax kangax merged commit 614878d into fabricjs:master Jul 20, 2015
@asturur asturur deleted the exportTransformMa branch July 20, 2015 22:43
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.

Issue with serializing / deserialzing SVGs
2 participants